|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs.provider.AbstractFileObject
org.apache.commons.vfs.provider.DelegateFileObject
public class DelegateFileObject
A file backed by another file.
Constructor Summary | |
---|---|
DelegateFileObject(FileName name,
AbstractFileSystem fileSystem,
FileObject file)
|
Method Summary | |
---|---|
void |
attachChild(FileName baseName,
FileType type)
Adds a child to this file. |
void |
close()
Close the delegated file. |
protected void |
doCreateFolder()
Creates this file as a folder. |
protected void |
doDelete()
Deletes the file. |
protected java.util.Map |
doGetAttributes()
Returns the attributes of this file. |
protected java.security.cert.Certificate[] |
doGetCertificates()
Returns the certificates of this file. |
protected FileContentInfo |
doGetContentInfo()
|
protected long |
doGetContentSize()
Returns the size of the file content (in bytes). |
protected java.io.InputStream |
doGetInputStream()
Creates an input stream to read the file content from. |
protected long |
doGetLastModifiedTime()
Returns the last-modified time of this file. |
protected java.io.OutputStream |
doGetOutputStream(boolean bAppend)
Creates an output stream to write the file content to. |
protected RandomAccessContent |
doGetRandomAccessContent(RandomAccessMode mode)
Creates access to the file for random i/o. |
protected FileType |
doGetType()
Determines the type of the file, returns null if the file does not exist. |
protected boolean |
doIsHidden()
Determines if this file is hidden. |
protected boolean |
doIsReadable()
Determines if this file can be read. |
protected boolean |
doIsWriteable()
Determines if this file can be written to. |
protected java.lang.String[] |
doListChildren()
Lists the children of the file. |
protected void |
doRemoveAttribute(java.lang.String atttrName)
Removes an attribute of this file. |
protected void |
doRename(FileObject newFile)
Renames the file. |
protected void |
doSetAttribute(java.lang.String atttrName,
java.lang.Object value)
Sets an attribute of this file. |
protected boolean |
doSetLastModTime(long modtime)
Sets the last-modified time of this file. |
void |
fileChanged(FileChangeEvent event)
Called when a file is changed. |
void |
fileCreated(FileChangeEvent event)
Called when a file is created. |
void |
fileDeleted(FileChangeEvent event)
Called when a file is deleted. |
FileObject |
getDelegateFile()
Get access to the delegated file. |
void |
refresh()
Refresh file information. |
void |
setFile(FileObject file)
Attaches or detaches the target file. |
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileObject |
---|
canRenameTo, childrenChanged, childrenChanged, copyFrom, createFile, createFolder, delete, delete, doAttach, doCreateFileContent, doDetach, doIsSameFile, doListChildrenResolved, doSetLastModifiedTime, endOutput, exists, finalize, findFiles, findFiles, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isHidden, isReadable, isSameFile, isWriteable, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, resolveFile, resolveFile, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DelegateFileObject(FileName name, AbstractFileSystem fileSystem, FileObject file) throws FileSystemException
FileSystemException
Method Detail |
---|
public FileObject getDelegateFile()
public void attachChild(FileName baseName, FileType type) throws java.lang.Exception
baseName
- The base FileName.type
- The FileType.
java.lang.Exception
- if an error occurs.public void setFile(FileObject file) throws java.lang.Exception
file
- The FileObject.
java.lang.Exception
- if an error occurs.protected FileType doGetType() throws FileSystemException
doGetType
in class AbstractFileObject
FileSystemException
protected boolean doIsReadable() throws FileSystemException
doIsReadable
in class AbstractFileObject
FileSystemException
protected boolean doIsWriteable() throws FileSystemException
doIsWriteable
in class AbstractFileObject
FileSystemException
protected boolean doIsHidden() throws FileSystemException
doIsHidden
in class AbstractFileObject
FileSystemException
protected java.lang.String[] doListChildren() throws java.lang.Exception
doListChildren
in class AbstractFileObject
java.lang.Exception
protected void doCreateFolder() throws java.lang.Exception
doCreateFolder
in class AbstractFileObject
java.lang.Exception
protected void doDelete() throws java.lang.Exception
doDelete
in class AbstractFileObject
java.lang.Exception
protected long doGetContentSize() throws java.lang.Exception
doGetType()
returns FileType.FILE
.
doGetContentSize
in class AbstractFileObject
java.lang.Exception
protected java.util.Map doGetAttributes() throws java.lang.Exception
doGetAttributes
in class AbstractFileObject
java.lang.Exception
protected void doSetAttribute(java.lang.String atttrName, java.lang.Object value) throws java.lang.Exception
doSetAttribute
in class AbstractFileObject
java.lang.Exception
protected java.security.cert.Certificate[] doGetCertificates() throws java.lang.Exception
doGetCertificates
in class AbstractFileObject
java.lang.Exception
protected long doGetLastModifiedTime() throws java.lang.Exception
doGetLastModifiedTime
in class AbstractFileObject
java.lang.Exception
protected boolean doSetLastModTime(long modtime) throws java.lang.Exception
doSetLastModTime
in class AbstractFileObject
java.lang.Exception
protected java.io.InputStream doGetInputStream() throws java.lang.Exception
doGetInputStream
in class AbstractFileObject
java.lang.Exception
protected java.io.OutputStream doGetOutputStream(boolean bAppend) throws java.lang.Exception
doGetOutputStream
in class AbstractFileObject
java.lang.Exception
public void fileCreated(FileChangeEvent event) throws java.lang.Exception
fileCreated
in interface FileListener
event
- The FileChangeEvent.
java.lang.Exception
- if an error occurs.public void fileDeleted(FileChangeEvent event) throws java.lang.Exception
fileDeleted
in interface FileListener
event
- The FileChangeEvent.
java.lang.Exception
- if an error occurs.public void fileChanged(FileChangeEvent event) throws java.lang.Exception
FileMonitor
.
fileChanged
in interface FileListener
event
- The FileChangeEvent.
java.lang.Exception
- if an error occurs.public void close() throws FileSystemException
close
in interface FileObject
close
in class AbstractFileObject
FileSystemException
- if an error occurs.FileContent.close()
public void refresh() throws FileSystemException
refresh
in interface FileObject
refresh
in class AbstractFileObject
FileSystemException
- if an error occurs.protected FileContentInfo doGetContentInfo() throws java.lang.Exception
java.lang.Exception
protected void doRename(FileObject newFile) throws java.lang.Exception
doRename
in class AbstractFileObject
java.lang.Exception
protected void doRemoveAttribute(java.lang.String atttrName) throws java.lang.Exception
doRemoveAttribute
in class AbstractFileObject
java.lang.Exception
protected RandomAccessContent doGetRandomAccessContent(RandomAccessMode mode) throws java.lang.Exception
doGetRandomAccessContent
in class AbstractFileObject
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |