|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.entityfs.impl.impl.adapter.AbstractROEntityAdapter<ZipFileSystemAdapter,ZipDirectoryAdapter>
org.entityfs.zip.ZipFileAdapter
public class ZipFileAdapter
| Constructor Summary | |
|---|---|
ZipFileAdapter(ZipFileSystemAdapter fs,
ZipDirectoryAdapter parent,
String name,
ZipEntry entry)
|
|
| Method Summary | |
|---|---|
boolean |
canRead()
Subclasses may override as needed. |
void |
copyFrom(ReadableByteChannel rbc)
|
void |
copyTo(OutputStream os)
Copy the file contents to the output stream. |
void |
copyTo(WritableByteChannel wbc)
Copy the file contents to the writable channel. |
boolean |
exists()
Subclasses may override as needed. |
long |
getDataSize()
Get the file's data size in bytes. |
EntityType |
getEntityType()
Get the EntityType for this entity. |
T |
getFileSystemAdapter()
Get the FileSystemAdapter for the file system where the entity
is. |
long |
getLastModified()
Get the last modification time for an entity. |
long |
getSize()
Get the file size in bytes. |
ZipEntry |
getZipEntry()
|
void |
init()
This implementation does nothing. |
ReadableByteChannel |
openChannelForRead()
|
FileChannel |
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 class org.entityfs.impl.impl.adapter.AbstractROEntityAdapter |
|---|
assertCanBeDeleted, canWrite, create, delete, getName, getParent, rename, setLastModified |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.entityfs.zip.ZipEntityAdapter |
|---|
getZipEntry |
| Methods inherited from interface org.entityfs.impl.adapter.EntityAdapter |
|---|
canRead, canWrite, create, delete, exists, getFileSystemAdapter, getLastModified, getName, getParent, init, rename, setLastModified |
| Constructor Detail |
|---|
public ZipFileAdapter(ZipFileSystemAdapter fs,
ZipDirectoryAdapter parent,
String name,
ZipEntry entry)
| Method Detail |
|---|
public void copyTo(OutputStream os)
FileAdapter
copyTo in interface FileAdapteros - The output stream. The stream is not closed by this method.public void copyTo(WritableByteChannel wbc)
FileAdapter
copyTo in interface FileAdapterwbc - The writable channel. The channel is not closed by this method.public void copyFrom(ReadableByteChannel rbc)
public OutputStream openForWrite(boolean append)
FileAdapter
See WritableFile.openForWrite() and
WritableFile.openForAppend() for the subtle and the
not-so-subtle differences between the append and overwrite modes.
openForWrite in interface FileAdapterappend - If true, new data will be appended to existing data
in the file. If false, existing data will be overwritten.public FileChannel openChannelForWrite(boolean append)
openChannelForWrite in interface FileAdapterpublic RandomAccess openForRandomAccess(RandomAccessMode mode)
openForRandomAccess in interface FileAdapterpublic long getSize()
FileAdapter
getSize in interface FileAdapterpublic long getDataSize()
FileAdapter
getDataSize in interface FileAdapterpublic InputStream openForRead()
FileAdapterInputStream on the file.
openForRead in interface FileAdapterInputStream for the file.public ReadableByteChannel openChannelForRead()
openChannelForRead in interface FileAdapterpublic EntityType getEntityType()
EntityAdapterEntityType for this entity.
getEntityType in interface EntityAdapterEntityType for this entity.public void replaceContents(FileAdapter fa)
FileAdapterImplementations must make sure that the file's last modification time is updated.
replaceContents in interface FileAdapterfa - 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.public ZipEntry getZipEntry()
public long getLastModified()
EntityAdapter
getLastModified in interface EntityAdapterpublic void init()
init in interface EntityAdapterpublic T getFileSystemAdapter()
EntityAdapterFileSystemAdapter for the file system where the entity
is.
getFileSystemAdapter in interface EntityAdapterFileSystemAdapter.public boolean exists()
exists in interface EntityAdaptertrue if the entity exists.public boolean canRead()
canRead in interface EntityAdaptertrue if the entity can be read.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||