org.entityfs.impl
Class AbstractFileDelegateProxy
java.lang.Object
org.entityfs.support.lang.ObjectProxySupport<T>
org.entityfs.impl.AbstractEntityDelegateProxy<FileDelegate,FileAdapter>
org.entityfs.impl.AbstractFileDelegateProxy
- All Implemented Interfaces:
- EntityDelegate, FileDelegate
- Direct Known Subclasses:
- AttributesEnablingFileDelegateProxy
public abstract class AbstractFileDelegateProxy
- extends AbstractEntityDelegateProxy<FileDelegate,FileAdapter>
- implements FileDelegate
This is an abstract stub implementation of a file delegate proxy. It forwards
all method calls to the proxied delegate. This can be used as a starting
point for custom implementations.
- Since:
- 1.0
- Author:
- Karl Gustafsson
- In_jar:
- entityfs-core
Methods inherited from class org.entityfs.impl.AbstractEntityDelegateProxy |
canRead, canWrite, copy, copyAttributes, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, rename, setLastModified, setOwner |
Methods inherited from interface org.entityfs.impl.EntityDelegate |
canRead, canWrite, copy, copyAttributes, exists, getDelegateOfTypeOrNull, getEntityAdapter, getFileSystem, getLastModified, getName, getOwner, init, isReadOnly, rename, setLastModified, setOwner |
AbstractFileDelegateProxy
protected AbstractFileDelegateProxy(FileDelegate proxied)
openForWrite
public OutputStream openForWrite(boolean append)
- Specified by:
openForWrite
in interface FileDelegate
openChannelForWrite
public WritableByteChannel openChannelForWrite(boolean append)
- Specified by:
openChannelForWrite
in interface FileDelegate
openForRead
public InputStream openForRead()
- Specified by:
openForRead
in interface FileDelegate
openChannelForRead
public ReadableByteChannel openChannelForRead()
- Specified by:
openChannelForRead
in interface FileDelegate
openForRandomAccess
public RandomAccess openForRandomAccess(RandomAccessMode mode)
- Specified by:
openForRandomAccess
in interface FileDelegate
getSize
public long getSize()
- Specified by:
getSize
in interface FileDelegate
getDataSize
public long getDataSize()
- Specified by:
getDataSize
in interface FileDelegate
delete
public void delete()
throws FileSystemException
- Description copied from interface:
FileDelegate
- Delete the file.
- Specified by:
delete
in interface FileDelegate
- Throws:
FileSystemException
- If the file cannot be deleted.
replaceContents
public void replaceContents(FileDelegate fd)
- Description copied from interface:
FileDelegate
- Replace the contents of this file with the contents of the supplied file.
Don't delete the other file. That is taken care of by the entity
implementation.
- Specified by:
replaceContents
in interface FileDelegate
- Parameters:
fd
- The file delegate with the contents that this file's contents
should be replaced with. fd
is not guaranteed to be in the
same file system as this file.