public class ZipFileObject extends AbstractFileObject<ZipFileSystem>
| Modifier and Type | Field and Description |
|---|---|
private java.util.HashSet<java.lang.String> |
children |
protected java.util.zip.ZipEntry |
entry
The ZipEntry.
|
private FileType |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
ZipFileObject(AbstractFileName name,
java.util.zip.ZipEntry entry,
ZipFileSystem fs,
boolean zipExists) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachChild(FileName childName)
Attaches a child.
|
protected void |
doAttach()
Attaches this file object to its file resource.
|
protected void |
doDetach()
Detaches this file object from its file resource.
|
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 FileType |
doGetType()
Returns the file's type.
|
protected java.lang.String[] |
doListChildren()
Lists the children of the file.
|
boolean |
isWriteable()
Determines if this file can be written to.
|
protected void |
setZipEntry(java.util.zip.ZipEntry entry)
Sets the details for this file object.
|
canRenameTo, childrenChanged, close, compareTo, copyFrom, createFile, createFolder, delete, delete, deleteAll, doCreateFileContent, doCreateFolder, doDelete, doGetAttributes, doGetCertificates, doGetOutputStream, doGetRandomAccessContent, doIsExecutable, doIsHidden, doIsReadable, doIsSameFile, doIsSymbolicLink, doIsWriteable, doListChildrenResolved, doRemoveAttribute, doRename, doSetAttribute, doSetExecutable, doSetLastModifiedTime, doSetReadable, doSetWritable, endOutput, exists, finalize, findFiles, findFiles, getAbstractFileSystem, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getPublicURIString, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isExecutable, isFile, isFolder, isHidden, isReadable, isSameFile, isSymbolicLink, iterator, listFiles, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, resolveFile, resolveFile, setExecutable, setReadable, setWritable, toStringprotected java.util.zip.ZipEntry entry
private final java.util.HashSet<java.lang.String> children
private FileType type
protected ZipFileObject(AbstractFileName name, java.util.zip.ZipEntry entry, ZipFileSystem fs, boolean zipExists) throws FileSystemException
FileSystemExceptionprotected void setZipEntry(java.util.zip.ZipEntry entry)
entry - ZIP information related to this file.public void attachChild(FileName childName)
TODO: Shouldn't this method have package-only visibility? Cannot change this without breaking binary compatibility.
childName - The name of the child.public boolean isWriteable()
throws FileSystemException
isWriteable in interface FileObjectisWriteable in class AbstractFileObject<ZipFileSystem>true if this file is writable, false if not.FileSystemException - if an error occurs.protected FileType doGetType()
doGetType in class AbstractFileObject<ZipFileSystem>protected java.lang.String[] doListChildren()
doListChildren in class AbstractFileObject<ZipFileSystem>protected long doGetContentSize()
doGetType() returns
FileType.FILE.doGetContentSize in class AbstractFileObject<ZipFileSystem>protected long doGetLastModifiedTime()
throws java.lang.Exception
doGetLastModifiedTime in class AbstractFileObject<ZipFileSystem>java.lang.Exception - if an error occurs.protected java.io.InputStream doGetInputStream()
throws java.lang.Exception
doGetType() returns
FileType.FILE. The input stream returned by this method is guaranteed to be closed before this method is
called again.doGetInputStream in class AbstractFileObject<ZipFileSystem>java.lang.Exception - if an error occurs.protected void doAttach()
throws java.lang.Exception
AbstractFileObjectThis method is called before any of the doBlah() or onBlah() methods. Sub-classes can use this method to perform lazy initialisation.
This implementation does nothing.
doAttach in class AbstractFileObject<ZipFileSystem>java.lang.Exception - if an error occurs.protected void doDetach()
throws java.lang.Exception
AbstractFileObjectCalled when this file is closed. Note that the file object may be reused later, so should be able to be reattached.
This implementation does nothing.
doDetach in class AbstractFileObject<ZipFileSystem>java.lang.Exception - if an error occurs.