public interface FileSystem extends Closeable
FileSystem will be mounted at some point on a VFS. The specific instance is only called when a
file from this filesystem is called upon. The path components passed in to the operations are canonical, with no "."
or ".." components.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Destroy this filesystem instance.
|
boolean |
delete(VirtualFile mountPoint,
VirtualFile target)
Attempt to delete a virtual file within this filesystem.
|
boolean |
exists(VirtualFile mountPoint,
VirtualFile target)
Ascertain the existance of a virtual file within this filesystem.
|
CodeSigner[] |
getCodeSigners(VirtualFile mountPoint,
VirtualFile target)
Get the
CodeSigners for a the virtual file. |
List<String> |
getDirectoryEntries(VirtualFile mountPoint,
VirtualFile target)
Read a directory.
|
File |
getFile(VirtualFile mountPoint,
VirtualFile target)
Get a real
File for the given path within this filesystem. |
long |
getLastModified(VirtualFile mountPoint,
VirtualFile target)
Get the last modification time of a virtual file within this filesystem.
|
File |
getMountSource()
Get the
File source provided at mount time. |
URI |
getRootURI()
Get the root URI for this file system, or
null if there is no valid root URI. |
long |
getSize(VirtualFile mountPoint,
VirtualFile target)
Get the size of a virtual file within this filesystem.
|
boolean |
isDirectory(VirtualFile mountPoint,
VirtualFile target)
Ascertain whether a virtual file within this filesystem is a directory.
|
boolean |
isFile(VirtualFile mountPoint,
VirtualFile target)
Ascertain whether a virtual file within this filesystem is a plain file.
|
boolean |
isReadOnly()
Determine whether this filesystem is read-only.
|
InputStream |
openInputStream(VirtualFile mountPoint,
VirtualFile target)
Open an input stream for the file at the given relative path.
|
File getFile(VirtualFile mountPoint, VirtualFile target) throws IOException
File for the given path within this filesystem. Some filesystem types will need to make a copy
in order to return this file; such copies should be cached and retained until the filesystem is closed. Depending
on the file type, the real path of the returned File may or may not bear a relationship to the virtual
path provided; if such a relationship is required, it must be negotiated at the time the filesystem is mounted.mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act uponIOException - if an I/O error occursInputStream openInputStream(VirtualFile mountPoint, VirtualFile target) throws IOException
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act uponIOException - if an I/O error occursboolean isReadOnly()
FileSystem implementation).true if the filesystem is read-onlyboolean delete(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act upontrue if the file was deleted, false if it failed for any reasonlong getSize(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act uponlong getLastModified(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act uponboolean exists(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act upontrue if the file exists, false otherwiseIOException - if an I/O error occursboolean isFile(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act upontrue if the file exists and is a plain file, false otherwiseboolean isDirectory(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act upontrue if the file exists and is a directory, false otherwiseList<String> getDirectoryEntries(VirtualFile mountPoint, VirtualFile target)
mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act uponCodeSigner[] getCodeSigners(VirtualFile mountPoint, VirtualFile target)
CodeSigners for a the virtual file.mountPoint - the mount point of the filesystem instance (guaranteed to be a parent of target)target - the virtual file to act uponCodeSigner for the virtual file or null if not signed.void close()
throws IOException
IOExceptions.close in interface AutoCloseableclose in interface CloseableIOException - if an I/O error occurs during closeFile getMountSource()
File source provided at mount time.URI getRootURI() throws URISyntaxException
null if there is no valid root URI.URISyntaxException - if the URI isn't validCopyright © 2012 JBoss by Red Hat. All Rights Reserved.