|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs.provider.AbstractVfsComponent
org.apache.commons.vfs.provider.AbstractFileSystem
A partial FileSystem
implementation.
Constructor Summary | |
protected |
AbstractFileSystem(FileName rootName,
FileObject parentLayer,
FileSystemOptions fileSystemOptions)
|
Method Summary | |
protected abstract void |
addCapabilities(Collection caps)
Adds the capabilities of this file system. |
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. |
void |
close()
Closes this component. |
void |
closeCommunicationLink()
Close the underlaying link used to access the files |
protected abstract FileObject |
createFile(FileName name)
Creates a file object. |
protected FileObject |
decorateFileObject(FileObject file)
|
protected void |
doCloseCommunicationLink()
Close the underlaying link used to access the files |
protected File |
doReplicateFile(FileObject file,
FileSelector selector)
Creates a temporary local copy of a file and its descendents. |
void |
fireFileChanged(FileObject file)
Fires a file changed event. |
void |
fireFileCreated(FileObject file)
Fires a file create event. |
void |
fireFileDeleted(FileObject file)
Fires a file delete event. |
Object |
getAttribute(String attrName)
Retrieves the attribute with the specified name. |
protected FileObject |
getFileFromCache(FileName name)
Returns a cached file. |
FileSystemManager |
getFileSystemManager()
Return the FileSystemManager used to instantiate this filesystem |
FileSystemOptions |
getFileSystemOptions()
Return the FileSystemOptions used to instantiate this filesystem |
double |
getLastModTimeAccuracy()
Returns the accuracy of the last modification time |
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 of this file system. |
boolean |
hasCapability(Capability capability)
Determines if this file system has a particular capability. |
void |
init()
Initialises this component. |
boolean |
isOpen()
check if this filesystem has open streams |
boolean |
isReleaseable()
returns true if no file is using this filesystem |
protected void |
notifyAllStreamsClosed()
will be called after all file-objects closed their streams. |
protected void |
putFileToCache(FileObject file)
Adds a file object to the cache. |
protected void |
removeFileFromCache(FileName name)
remove a cached file. |
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 descendents. |
FileObject |
resolveFile(FileName name)
Finds a file in this file system. |
FileObject |
resolveFile(String nameStr)
Finds a file in this file system. |
void |
setAttribute(String attrName,
Object value)
Sets the attribute with the specified name. |
Methods inherited from class org.apache.commons.vfs.provider.AbstractVfsComponent |
getContext, getLogger, setContext, setLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractFileSystem(FileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions)
Method Detail |
public void init() throws FileSystemException
init
in interface VfsComponent
init
in class AbstractVfsComponent
FileSystemException
public void close()
close
in interface VfsComponent
close
in class AbstractVfsComponent
public void closeCommunicationLink()
protected void doCloseCommunicationLink()
protected abstract FileObject createFile(FileName name) throws Exception
Exception
protected abstract void addCapabilities(Collection caps)
public FileName getRootName()
getRootName
in interface FileSystem
protected void putFileToCache(FileObject file)
protected FileObject getFileFromCache(FileName name)
protected void removeFileFromCache(FileName name)
public boolean hasCapability(Capability capability)
hasCapability
in interface FileSystem
capability
- The capability to check for.
public Object getAttribute(String attrName) throws FileSystemException
getAttribute
in interface FileSystem
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)
public void setAttribute(String attrName, Object value) throws FileSystemException
setAttribute
in interface FileSystem
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)
public FileObject getParentLayer() throws FileSystemException
getParentLayer
in interface FileSystem
FileSystemException
public FileObject getRoot() throws FileSystemException
getRoot
in interface FileSystem
FileSystemException
public FileObject resolveFile(String nameStr) throws FileSystemException
resolveFile
in interface FileSystem
nameStr
- The name of the file. This must be an absolute path.
FileSystemException
public FileObject resolveFile(FileName name) throws FileSystemException
resolveFile
in interface FileSystem
name
- The name of the file.
FileSystemException
protected FileObject decorateFileObject(FileObject file) throws FileSystemException
FileSystemException
public File replicateFile(FileObject file, FileSelector selector) throws FileSystemException
replicateFile
in interface FileSystem
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.public FileSystemOptions getFileSystemOptions()
getFileSystemOptions
in interface FileSystem
public FileSystemManager getFileSystemManager()
getFileSystemManager
in interface FileSystem
public double getLastModTimeAccuracy()
getLastModTimeAccuracy
in interface FileSystem
protected File doReplicateFile(FileObject file, FileSelector selector) throws Exception
Exception
public void addJunction(String junctionPoint, FileObject targetFile) throws FileSystemException
addJunction
in interface FileSystem
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).public void removeJunction(String junctionPoint) throws FileSystemException
removeJunction
in interface FileSystem
junctionPoint
- The junction to remove.
FileSystemException
- On error removing the junction.public void addListener(FileObject file, FileListener listener)
addListener
in interface FileSystem
file
- The file to attach the listener to.listener
- The listener to add.public void removeListener(FileObject file, FileListener listener)
removeListener
in interface FileSystem
file
- The file to remove the listener from.listener
- The listener to remove.public void fireFileCreated(FileObject file)
public void fireFileDeleted(FileObject file)
public void fireFileChanged(FileObject file)
FileMonitor
.
public boolean isReleaseable()
protected void notifyAllStreamsClosed()
public boolean isOpen()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |