|
|||||||||
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 FileAdapter
os
- The output stream. The stream is not closed by this method.public void copyTo(WritableByteChannel wbc)
FileAdapter
copyTo
in interface FileAdapter
wbc
- 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 FileAdapter
append
- 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 FileAdapter
public RandomAccess openForRandomAccess(RandomAccessMode mode)
openForRandomAccess
in interface FileAdapter
public long getSize()
FileAdapter
getSize
in interface FileAdapter
public long getDataSize()
FileAdapter
getDataSize
in interface FileAdapter
public InputStream openForRead()
FileAdapter
InputStream
on the file.
openForRead
in interface FileAdapter
InputStream
for the file.public ReadableByteChannel openChannelForRead()
openChannelForRead
in interface FileAdapter
public EntityType getEntityType()
EntityAdapter
EntityType
for this entity.
getEntityType
in interface EntityAdapter
EntityType
for this entity.public void replaceContents(FileAdapter fa)
FileAdapter
Implementations must make sure that the file's last modification time is updated.
replaceContents
in interface FileAdapter
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.public ZipEntry getZipEntry()
public long getLastModified()
EntityAdapter
getLastModified
in interface EntityAdapter
public void init()
init
in interface EntityAdapter
public T getFileSystemAdapter()
EntityAdapter
FileSystemAdapter
for the file system where the entity
is.
getFileSystemAdapter
in interface EntityAdapter
FileSystemAdapter
.public boolean exists()
exists
in interface EntityAdapter
true
if the entity exists.public boolean canRead()
canRead
in interface EntityAdapter
true
if the entity can be read.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |