public class ZipFileSystem extends AbstractFileSystem
Constructor and Description |
---|
ZipFileSystem(AbstractFileName rootFileName,
FileObject parentLayer,
FileSystemOptions fileSystemOptions)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCapabilities(Collection<Capability> caps)
Returns the capabilities of this file system.
|
protected FileObject |
createFile(AbstractFileName name)
Creates a file object.
|
protected ZipFile |
createZipFile(File file)
Creates a Zip file.
|
protected ZipFileObject |
createZipFileObject(AbstractFileName fileName,
ZipEntry entry)
Creates a new Zip file object.
|
protected void |
doCloseCommunicationLink()
Closes the underlying link used to access the files.
|
protected Charset |
getCharset()
Gets the Charset, defaults to
StandardCharsets.UTF_8 , the value used in ZipFile . |
protected FileObject |
getFileFromCache(FileName name)
Gets a cached file.
|
protected ZipFile |
getZipFile()
Gets the zip file.
|
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.
|
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, setAttribute
getContext, getLogger, setContext, setLogger
public ZipFileSystem(AbstractFileName rootFileName, FileObject parentLayer, FileSystemOptions fileSystemOptions) throws FileSystemException
rootFileName
- The root file name of this file system.parentLayer
- The parent layer of this file system.fileSystemOptions
- Options to build this file system.FileSystemException
- If the parent layer does not exist, or on error replicating the file.protected void addCapabilities(Collection<Capability> caps)
addCapabilities
in class AbstractFileSystem
caps
- collections of Capabilities, can be immutable.protected FileObject createFile(AbstractFileName name) throws FileSystemException
createFile
in class AbstractFileSystem
name
- name referencing the new file.FileSystemException
protected ZipFile createZipFile(File file) throws FileSystemException
file
- the underlying file.FileSystemException
- if a file system error occurs.protected ZipFileObject createZipFileObject(AbstractFileName fileName, ZipEntry entry) throws FileSystemException
fileName
- the underlying file.entry
- the Zip entry.FileSystemException
- if a file system error occurs.protected void doCloseCommunicationLink()
AbstractFileSystem
doCloseCommunicationLink
in class AbstractFileSystem
protected Charset getCharset()
StandardCharsets.UTF_8
, the value used in ZipFile
.protected FileObject getFileFromCache(FileName name)
getFileFromCache
in class AbstractFileSystem
name
- name to search for.protected ZipFile getZipFile() throws FileSystemException
FileSystemException
- if a file system error occurs.public void init() throws FileSystemException
AbstractFileSystem
init
in interface VfsComponent
init
in class AbstractFileSystem
FileSystemException
- if an error occurs.protected void putFileToCache(FileObject file)
putFileToCache
in class AbstractFileSystem
file
- the file to add.protected void removeFileFromCache(FileName name)
removeFileFromCache
in class AbstractFileSystem
name
- The file name to remove.Copyright © 2002–2025 The Apache Software Foundation. All rights reserved.