Package org.codehaus.mojo.mrm.api
Class BaseFileSystem
java.lang.Object
org.codehaus.mojo.mrm.api.BaseFileSystem
- All Implemented Interfaces:
FileSystem
Base implementation of
FileSystem
that all implementations should extend from.- Since:
- 1.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the entry at the specified path.protected Entry
get
(DirectoryEntry parent, String name) Gets the named entry in the specified directory.getRoot()
Returns the root directory entry.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.mojo.mrm.api.FileSystem
getLastModified, listEntries, put
-
Constructor Details
-
BaseFileSystem
public BaseFileSystem()
-
-
Method Details
-
getRoot
Description copied from interface:FileSystem
Returns the root directory entry.- Specified by:
getRoot
in interfaceFileSystem
- Returns:
- the root directory entry.
-
get
Description copied from interface:FileSystem
Returns the entry at the specified path. Anull
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 interfaceFileSystem
- Parameters:
path
- the path to retrieve theEntry
of.- Returns:
- the
Entry
ornull
if the path definitely does not exist.
-
get
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
ornull
if the entry does not exist.
-