public class ZipFileSystem extends AbstractFileSystem
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<FileName,FileObject> |
cache
Cache doesn't need to be synchronized since it is read-only.
|
private java.nio.charset.Charset |
charset |
private java.io.File |
file |
private static org.apache.commons.logging.Log |
LOG |
private java.util.zip.ZipFile |
zipFile |
| Constructor and Description |
|---|
ZipFileSystem(AbstractFileName rootName,
FileObject parentLayer,
FileSystemOptions fileSystemOptions) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCapabilities(java.util.Collection<Capability> caps)
Returns the capabilities of this file system.
|
protected FileObject |
createFile(AbstractFileName name)
Creates a file object.
|
protected java.util.zip.ZipFile |
createZipFile(java.io.File file) |
protected ZipFileObject |
createZipFileObject(AbstractFileName name,
java.util.zip.ZipEntry entry) |
protected void |
doCloseCommunicationLink()
Closes the underlying link used to access the files.
|
protected java.nio.charset.Charset |
getCharset() |
protected FileObject |
getFileFromCache(FileName name)
Returns a cached file.
|
protected java.util.zip.ZipFile |
getZipFile() |
void |
init()
Initializes this component.
|
protected void |
putFileToCache(FileObject file)
Adds a file object to the cache.
|
protected void |
removeFileFromCache(FileName name)
remove a cached file.
|
java.lang.String |
toString() |
addJunction, addListener, close, closeCommunicationLink, decorateFileObject, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, isOpen, isReleaseable, notifyAllStreamsClosed, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttributegetContext, getLogger, setContext, setLoggerprivate static final org.apache.commons.logging.Log LOG
private final java.io.File file
private final java.nio.charset.Charset charset
private java.util.zip.ZipFile zipFile
private final java.util.Map<FileName,FileObject> cache
public ZipFileSystem(AbstractFileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions) throws FileSystemException
FileSystemExceptionpublic void init()
throws FileSystemException
AbstractFileSysteminit in interface VfsComponentinit in class AbstractFileSystemFileSystemException - if an error occurs.protected java.util.zip.ZipFile getZipFile()
throws FileSystemException
FileSystemExceptionprotected ZipFileObject createZipFileObject(AbstractFileName name, java.util.zip.ZipEntry entry) throws FileSystemException
FileSystemExceptionprotected java.util.zip.ZipFile createZipFile(java.io.File file)
throws FileSystemException
FileSystemExceptionprotected void doCloseCommunicationLink()
AbstractFileSystemdoCloseCommunicationLink in class AbstractFileSystemprotected void addCapabilities(java.util.Collection<Capability> caps)
addCapabilities in class AbstractFileSystemcaps - collections of Capabilities, can be immutable.protected FileObject createFile(AbstractFileName name) throws FileSystemException
createFile in class AbstractFileSystemname - name referencing the new file.FileSystemExceptionprotected void putFileToCache(FileObject file)
putFileToCache in class AbstractFileSystemfile - the file to add.protected java.nio.charset.Charset getCharset()
protected FileObject getFileFromCache(FileName name)
getFileFromCache in class AbstractFileSystemname - name to search for.protected void removeFileFromCache(FileName name)
removeFileFromCache in class AbstractFileSystemname - The file name to remove.public java.lang.String toString()
toString in class java.lang.Object