|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.mojo.mrm.api.BaseFileSystem
public abstract class BaseFileSystem
Base implementation of FileSystem that all implementations should extend from.
| Constructor Summary | |
|---|---|
BaseFileSystem()
|
|
| Method Summary | |
|---|---|
protected Entry |
get(DirectoryEntry parent,
String name)
Gets the named entry in the specified directory. |
Entry |
get(String path)
Returns the entry at the specified path. |
DirectoryEntry |
getRoot()
Returns the root directory entry. |
DirectoryEntry |
mkdir(DirectoryEntry parent,
String name)
Makes the specified child directory. |
FileEntry |
put(DirectoryEntry parent,
String name,
byte[] content)
Puts the specified content into a the specified directory. |
FileEntry |
put(DirectoryEntry parent,
String name,
InputStream content)
Puts the specified content into a the specified directory. |
void |
remove(Entry entry)
Removes the specified entry (and if the entry is a directory, all its children). |
| 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 |
| Constructor Detail |
|---|
public BaseFileSystem()
| Method Detail |
|---|
public DirectoryEntry getRoot()
getRoot in interface FileSystempublic Entry get(String path)
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.
get in interface FileSystempath - the path to retrieve the Entry of.
Entry or null if the path definitely does not exist.
protected Entry get(DirectoryEntry parent,
String name)
parent - the directory.name - the name of the entry to get.
Entry or null if the entry does not exist.
public DirectoryEntry mkdir(DirectoryEntry parent,
String name)
mkdir in interface FileSystemparent - the directory in which the child is to be created.name - the name of the child directory.
public FileEntry put(DirectoryEntry parent,
String name,
InputStream content)
throws IOException
put in interface FileSystemparent - the directory in which the content is to be created/updated.name - the name of the file.content - the content (implementer is responsible for closing).
FileEntry that was created/updated.
IOException - if the content could not be read/written.
public FileEntry put(DirectoryEntry parent,
String name,
byte[] content)
throws IOException
put in interface FileSystemparent - the directory in which the content is to be created/updated.name - the name of the file.content - the content.
FileEntry that was created/updated.
IOException - if the content could not be read/written.public void remove(Entry entry)
remove in interface FileSystementry - the entry to remove.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||