|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs.impl.DecoratedFileObject
org.apache.commons.vfs.impl.SynchronizedFileObject
This decorator synchronize all access to the FileObject
Constructor Summary | |
SynchronizedFileObject(FileObject fileObject)
|
Method Summary | |
void |
close()
Closes this file, and its content. |
void |
copyFrom(FileObject srcFile,
FileSelector selector)
Copies another file, and all its descendents, to this file. |
void |
createFile()
Creates this file, if it does not exist. |
void |
createFolder()
Creates this folder, if it does not exist. |
boolean |
delete()
Deletes this file. |
int |
delete(FileSelector selector)
Deletes all descendents of this file that match a selector. |
boolean |
exists()
Determines if this file exists. |
FileObject[] |
findFiles(FileSelector selector)
Finds the set of matching descendents of this file, in depthwise order. |
void |
findFiles(FileSelector selector,
boolean depthwise,
List selected)
Finds the set of matching descendents of this file. |
FileObject |
getChild(String name)
Returns a child of this file. |
FileObject[] |
getChildren()
Lists the children of this file. |
FileContent |
getContent()
Returns this file's content. |
FileType |
getType()
Returns this file's type. |
boolean |
isHidden()
Determines if this file is hidden. |
boolean |
isReadable()
Determines if this file can be read. |
boolean |
isWriteable()
Determines if this file can be written to. |
void |
moveTo(FileObject destFile)
Move this file. |
FileObject |
resolveFile(String path)
Finds a file, relative to this file. |
FileObject |
resolveFile(String name,
NameScope scope)
Finds a file, relative to this file. |
Methods inherited from class org.apache.commons.vfs.impl.DecoratedFileObject |
canRenameTo, getDecoratedFileObject, getFileOperations, getFileSystem, getName, getParent, getURL, isAttached, isContentOpen, refresh, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SynchronizedFileObject(FileObject fileObject)
Method Detail |
public void close() throws FileSystemException
FileObject
The file object can continue to be used after this method is called.
close
in interface FileObject
close
in class DecoratedFileObject
FileSystemException
public void copyFrom(FileObject srcFile, FileSelector selector) throws FileSystemException
FileObject
This method is not transactional. If it fails and throws an exception, this file will potentially only be partially copied.
copyFrom
in interface FileObject
copyFrom
in class DecoratedFileObject
FileSystemException
public void createFile() throws FileSystemException
FileObject
createFile
in interface FileObject
createFile
in class DecoratedFileObject
FileSystemException
public void createFolder() throws FileSystemException
FileObject
createFolder
in interface FileObject
createFolder
in class DecoratedFileObject
FileSystemException
public boolean delete() throws FileSystemException
FileObject
FileObject.delete(FileSelector)
for that.
delete
in interface FileObject
delete
in class DecoratedFileObject
FileSystemException
public int delete(FileSelector selector) throws FileSystemException
FileObject
This method is not transactional. If it fails and throws an exception, this file will potentially only be partially deleted.
delete
in interface FileObject
delete
in class DecoratedFileObject
FileSystemException
public boolean exists() throws FileSystemException
FileObject
exists
in interface FileObject
exists
in class DecoratedFileObject
FileSystemException
public void findFiles(FileSelector selector, boolean depthwise, List selected) throws FileSystemException
FileObject
findFiles
in interface FileObject
findFiles
in class DecoratedFileObject
FileSystemException
public FileObject[] findFiles(FileSelector selector) throws FileSystemException
FileObject
findFiles
in interface FileObject
findFiles
in class DecoratedFileObject
FileSystemException
public FileObject getChild(String name) throws FileSystemException
FileObject
null
when the child does not exist. This differs from
FileObject.resolveFile( String, NameScope)
which never returns null.
getChild
in interface FileObject
getChild
in class DecoratedFileObject
FileSystemException
public FileObject[] getChildren() throws FileSystemException
FileObject
getChildren
in interface FileObject
getChildren
in class DecoratedFileObject
FileSystemException
public FileContent getContent() throws FileSystemException
FileObject
FileContent
returned by this
method can be used to read and write the content of the file.
This method can be called if the file does not exist, and
the returned FileContent
can be used to create the file
by writing its content.
getContent
in interface FileObject
getContent
in class DecoratedFileObject
FileSystemException
public FileType getType() throws FileSystemException
FileObject
getType
in interface FileObject
getType
in class DecoratedFileObject
FileSystemException
public boolean isHidden() throws FileSystemException
FileObject
isHidden
in interface FileObject
isHidden
in class DecoratedFileObject
FileSystemException
public boolean isReadable() throws FileSystemException
FileObject
isReadable
in interface FileObject
isReadable
in class DecoratedFileObject
FileSystemException
public boolean isWriteable() throws FileSystemException
FileObject
isWriteable
in interface FileObject
isWriteable
in class DecoratedFileObject
FileSystemException
public void moveTo(FileObject destFile) throws FileSystemException
FileObject
If the destFile exists, it is deleted first
moveTo
in interface FileObject
moveTo
in class DecoratedFileObject
FileSystemException
public FileObject resolveFile(String name, NameScope scope) throws FileSystemException
FileObject
NameScope
for a description of how names are resolved in the different scopes.
resolveFile
in interface FileObject
resolveFile
in class DecoratedFileObject
FileSystemException
public FileObject resolveFile(String path) throws FileSystemException
FileObject
resolveFile( path, NameScope.FILE_SYSTEM )
.
resolveFile
in interface FileObject
resolveFile
in class DecoratedFileObject
FileSystemException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |