public interface FileSystem
Modifier and Type | Method and Description |
---|---|
void |
addJunction(String junctionPoint,
FileObject targetFile)
Adds a junction to this file system.
|
void |
addListener(FileObject file,
FileListener listener)
Adds a listener on a file in this file system.
|
Object |
getAttribute(String attrName)
Gets the value of an attribute of the file system.
|
FileSystemManager |
getFileSystemManager()
Returns a reference to the FileSytemManager.
|
FileSystemOptions |
getFileSystemOptions()
Returns the FileSystemOptions used to instantiate this file system.
|
double |
getLastModTimeAccuracy()
Returns the accuracy of the last modification time in milliseconds.
|
FileObject |
getParentLayer()
Returns the parent layer if this is a layered file system.
|
FileObject |
getRoot()
Returns the root file of this file system.
|
FileName |
getRootName()
Returns the name of the root file of this file system.
|
String |
getRootURI()
The root URI passed as a file system option or obtained from the rootName.
|
boolean |
hasCapability(Capability capability)
Determines if this file system has a particular capability.
|
void |
removeJunction(String junctionPoint)
Removes a junction from this file system.
|
void |
removeListener(FileObject file,
FileListener listener)
Removes a listener from a file in this file system.
|
File |
replicateFile(FileObject file,
FileSelector selector)
Creates a temporary local copy of a file and its descendants.
|
FileObject |
resolveFile(FileName name)
Finds a file in this file system.
|
FileObject |
resolveFile(String name)
Finds a file in this file system.
|
void |
setAttribute(String attrName,
Object value)
Sets the value of an attribute of the file's content.
|
FileObject getRoot() throws FileSystemException
FileSystemException
- if an error occurs.FileName getRootName()
String getRootURI()
boolean hasCapability(Capability capability)
TODO - Move this to another interface, so that set of capabilities can be queried.
capability
- The capability to check for.FileObject getParentLayer() throws FileSystemException
FileSystemException
- if an error occurs.Object getAttribute(String attrName) throws FileSystemException
TODO - change to Map getAttributes()
instead?
TODO - define the standard attribute names, and define which attrs are guaranteed to be present.
attrName
- The name of the attribute.FileSystemException
- If the file does not exist, or is being written, or if the
attribute is unknown.FileContent.getAttribute(java.lang.String)
void setAttribute(String attrName, Object value) throws FileSystemException
attrName
- The name of the attribute.value
- The value of the attribute.FileSystemException
- If the file is read-only, or is being read, or if the attribute is not supported, or
on error setting the attribute.FileContent.setAttribute(java.lang.String, java.lang.Object)
FileObject resolveFile(FileName name) throws FileSystemException
name
- The name of the file.FileSystemException
- if an error occurs.FileObject resolveFile(String name) throws FileSystemException
name
- The name of the file. This must be an absolute path.FileSystemException
- if an error occurs.void addListener(FileObject file, FileListener listener)
file
- The file to attach the listener to.listener
- The listener to add.void removeListener(FileObject file, FileListener listener)
file
- The file to remove the listener from.listener
- The listener to remove.void addJunction(String junctionPoint, FileObject targetFile) throws FileSystemException
junctionPoint
- The point in this file system to add the junction.targetFile
- The file to link to.FileSystemException
- If this file system does not support junctions, or the junction point or target file
is invalid (the file system may not support nested junctions, for example).void removeJunction(String junctionPoint) throws FileSystemException
junctionPoint
- The junction to remove.FileSystemException
- On error removing the junction.File replicateFile(FileObject file, FileSelector selector) throws FileSystemException
Note that the local copy may include additonal files, that were not selected by the given selector.
TODO - Add options to indicate whether the caller is happy to deal with extra files being present locally (eg if the file has been replicated previously), or whether the caller expects only the selected files to be present.
file
- The file to replicate.selector
- The selector to use to select the files to replicate.FileSystemException
- If this file does not exist, or on error replicating the file.FileSystemOptions getFileSystemOptions()
FileSystemManager getFileSystemManager()
double getLastModTimeAccuracy()
The local file provider is not very smart in figuring this out, for remote access to file systems the providers typically don't know the value of the underlying real file system.
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.