public interface FileSystem extends Serializable
| Modifier and Type | Method and Description |
|---|---|
Entry |
get(String path)
Returns the entry at the specified path.
|
long |
getLastModified(DirectoryEntry entry)
Returns the time that the specified directory entry was last modified.
|
DirectoryEntry |
getRoot()
Returns the root directory entry.
|
Entry[] |
listEntries(DirectoryEntry directory)
Lists the entries in the specified directory.
|
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).
|
Entry[] listEntries(DirectoryEntry directory)
FileEntry.getInputStream() method,
although get(String) returning null is also definitive, a non-null does not prove
existence).directory - the directory to list the entries of.null. The caller can safely
modify the returned array.DirectoryEntry getRoot()
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.long getLastModified(DirectoryEntry entry) throws IOException
DefaultDirectoryEntry.getLastModified() delegates to this method.entry - the directory entry.long value representing the time the directory was
last modified, measured in milliseconds since the epoch
(00:00:00 GMT, January 1, 1970), or 0L if the
the time is unknown.IOException - if an I/O error occurs.DirectoryEntry mkdir(DirectoryEntry parent, String name)
parent - the directory in which the child is to be created.name - the name of the child directory.UnsupportedOperationException - if the repository is read-only.FileEntry put(DirectoryEntry parent, String name, InputStream content) throws IOException
parent - 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.UnsupportedOperationException - if the repository is read-only.IOException - if the content could not be read/written.FileEntry put(DirectoryEntry parent, String name, byte[] content) throws IOException
parent - 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.UnsupportedOperationException - if the repository is read-only.IOException - if the content could not be read/written.void remove(Entry entry)
entry - the entry to remove.UnsupportedOperationException - if the repository is read-only.Copyright © 2009–2022 MojoHaus. All rights reserved.