|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface FileAdapter
This is an adapter for a file in the backing file system.
| Method Summary | |
|---|---|
void |
copyTo(OutputStream os)
Copy the file contents to the output stream. |
void |
copyTo(WritableByteChannel c)
Copy the file contents to the writable channel. |
long |
getDataSize()
Get the file's data size in bytes. |
long |
getSize()
Get the file size in bytes. |
ReadableByteChannel |
openChannelForRead()
|
WritableByteChannel |
openChannelForWrite(boolean append)
|
RandomAccess |
openForRandomAccess(RandomAccessMode mode)
|
InputStream |
openForRead()
Open an InputStream on the file. |
OutputStream |
openForWrite(boolean append)
Open the file for writing. |
void |
replaceContents(FileAdapter fa)
Replace the contents of this file adapter with the contents of the supplied file adapter. |
| Methods inherited from interface org.entityfs.impl.adapter.EntityAdapter |
|---|
canRead, canWrite, create, delete, exists, getEntityType, getFileSystemAdapter, getLastModified, getName, getParent, init, rename, setLastModified |
| Method Detail |
|---|
long getSize()
long getDataSize()
InputStream openForRead()
InputStream on the file.
InputStream for the file.OutputStream openForWrite(boolean append)
See WritableFile.openForWrite() and
WritableFile.openForAppend() for the subtle and the
not-so-subtle differences between the append and overwrite modes.
append - If true, new data will be appended to existing data
in the file. If false, existing data will be overwritten.ReadableByteChannel openChannelForRead()
WritableByteChannel openChannelForWrite(boolean append)
RandomAccess openForRandomAccess(RandomAccessMode mode)
void copyTo(OutputStream os)
os - The output stream. The stream is not closed by this method.void copyTo(WritableByteChannel c)
c - The writable channel. The channel is not closed by this method.void replaceContents(FileAdapter fa)
Implementations must make sure that the file's last modification time is updated.
fa - The file adapter whose contents this file adapter's contents
should be replaced with. fa is guaranteed to be in the
same file system as this file adapter.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||