Class BaseFileSystem

java.lang.Object
org.codehaus.mojo.mrm.api.BaseFileSystem
All Implemented Interfaces:
FileSystem

public abstract class BaseFileSystem extends Object implements FileSystem
Base implementation of FileSystem that all implementations should extend from.
Since:
1.0
  • Constructor Details

    • BaseFileSystem

      public BaseFileSystem()
  • Method Details

    • getRoot

      public DirectoryEntry getRoot()
      Description copied from interface: FileSystem
      Returns the root directory entry.
      Specified by:
      getRoot in interface FileSystem
      Returns:
      the root directory entry.
    • get

      public Entry get(String path)
      Description copied from interface: FileSystem
      Returns the entry at the specified path. A null result proves the path does not exist, however very lazy caching implementations may return a non-null entry for paths which do not exist.
      Specified by:
      get in interface FileSystem
      Parameters:
      path - the path to retrieve the Entry of.
      Returns:
      the Entry or null if the path definitely does not exist.
    • get

      protected Entry get(DirectoryEntry parent, String name)
      Gets the named entry in the specified directory. The default implementation lists all the entries in the directory and looks for the one with the matching name. Caching implementations will likely want to override this behaviour.
      Parameters:
      parent - the directory.
      name - the name of the entry to get.
      Returns:
      the Entry or null if the entry does not exist.