public class DelegateFileObject extends AbstractFileObject implements FileListener
| Constructor and Description |
|---|
DelegateFileObject(FileName name,
AbstractFileSystem fileSystem,
FileObject file) |
| Modifier and Type | Method and Description |
|---|---|
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 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 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 |
doSetAttribute(java.lang.String atttrName,
java.lang.Object value)
Sets an attribute of this file.
|
protected void |
doSetLastModifiedTime(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.
|
void |
setFile(FileObject file)
Attaches or detaches the target file.
|
canRenameTo, childrenChanged, childrenChanged, copyFrom, createFile, createFolder, delete, delete, doAttach, doDetach, doGetRandomAccessContent, doIsSameFile, doListChildrenResolved, doRename, 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, refresh, resolveFile, resolveFile, toStringpublic DelegateFileObject(FileName name, AbstractFileSystem fileSystem, FileObject file) throws FileSystemException
FileSystemExceptionpublic void attachChild(FileName baseName, FileType type) throws java.lang.Exception
java.lang.Exceptionpublic void setFile(FileObject file) throws java.lang.Exception
java.lang.Exceptionprotected FileType doGetType() throws FileSystemException
doGetType in class AbstractFileObjectFileSystemExceptionprotected boolean doIsReadable()
throws FileSystemException
doIsReadable in class AbstractFileObjectFileSystemExceptionprotected boolean doIsWriteable()
throws FileSystemException
doIsWriteable in class AbstractFileObjectFileSystemExceptionprotected boolean doIsHidden()
throws FileSystemException
doIsHidden in class AbstractFileObjectFileSystemExceptionprotected java.lang.String[] doListChildren()
throws java.lang.Exception
doListChildren in class AbstractFileObjectjava.lang.Exceptionprotected void doCreateFolder()
throws java.lang.Exception
doCreateFolder in class AbstractFileObjectjava.lang.Exceptionprotected void doDelete()
throws java.lang.Exception
doDelete in class AbstractFileObjectjava.lang.Exceptionprotected long doGetContentSize()
throws java.lang.Exception
doGetType() returns FileType.FILE.doGetContentSize in class AbstractFileObjectjava.lang.Exceptionprotected java.util.Map doGetAttributes()
throws java.lang.Exception
doGetAttributes in class AbstractFileObjectjava.lang.Exceptionprotected void doSetAttribute(java.lang.String atttrName,
java.lang.Object value)
throws java.lang.Exception
doSetAttribute in class AbstractFileObjectjava.lang.Exceptionprotected java.security.cert.Certificate[] doGetCertificates()
throws java.lang.Exception
doGetCertificates in class AbstractFileObjectjava.lang.Exceptionprotected long doGetLastModifiedTime()
throws java.lang.Exception
doGetLastModifiedTime in class AbstractFileObjectjava.lang.Exceptionprotected void doSetLastModifiedTime(long modtime)
throws java.lang.Exception
doSetLastModifiedTime in class AbstractFileObjectjava.lang.Exceptionprotected java.io.InputStream doGetInputStream()
throws java.lang.Exception
doGetInputStream in class AbstractFileObjectjava.lang.Exceptionprotected java.io.OutputStream doGetOutputStream(boolean bAppend)
throws java.lang.Exception
doGetOutputStream in class AbstractFileObjectjava.lang.Exceptionpublic void fileCreated(FileChangeEvent event) throws java.lang.Exception
fileCreated in interface FileListenerjava.lang.Exceptionpublic void fileDeleted(FileChangeEvent event) throws java.lang.Exception
fileDeleted in interface FileListenerjava.lang.Exceptionpublic void fileChanged(FileChangeEvent event) throws java.lang.Exception
FileMonitor.fileChanged in interface FileListenerjava.lang.Exceptionpublic void close()
throws FileSystemException
close in interface FileObjectclose in class AbstractFileObjectFileSystemException - On error closing the file.FileContent.close()