Class ZipFileSystem
java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractFileSystem
org.apache.commons.vfs2.provider.zip.ZipFileSystem
- All Implemented Interfaces:
FileSystem
,VfsComponent
- Direct Known Subclasses:
JarFileSystem
A read-only file system for ZIP and JAR files.
-
Constructor Summary
ConstructorsConstructorDescriptionZipFileSystem
(AbstractFileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) protected ZipFileObject
createZipFileObject
(AbstractFileName name, ZipEntry entry) protected void
Close the underlying link used to access the filesprotected FileObject
getFileFromCache
(FileName name) Returns a cached file.protected ZipFile
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.toString()
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
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
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
Constructor Details
-
ZipFileSystem
public ZipFileSystem(AbstractFileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions) throws FileSystemException - Throws:
FileSystemException
-
-
Method Details
-
init
Description copied from class:AbstractFileSystem
Initializes this component.- Specified by:
init
in interfaceVfsComponent
- Overrides:
init
in classAbstractFileSystem
- Throws:
FileSystemException
- if an error occurs.
-
getZipFile
- Throws:
FileSystemException
-
createZipFileObject
protected ZipFileObject createZipFileObject(AbstractFileName name, ZipEntry entry) throws FileSystemException - Throws:
FileSystemException
-
createZipFile
- Throws:
FileSystemException
-
doCloseCommunicationLink
Description copied from class:AbstractFileSystem
Close the underlying link used to access the files- Overrides:
doCloseCommunicationLink
in classAbstractFileSystem
-
addCapabilities
Returns the capabilities of this file system.- Specified by:
addCapabilities
in classAbstractFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
createFile
Creates a file object.- Specified by:
createFile
in classAbstractFileSystem
- Parameters:
name
- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
FileSystemException
-
putFileToCache
Adds a file object to the cache.- Overrides:
putFileToCache
in classAbstractFileSystem
- Parameters:
file
- the file to add.
-
getFileFromCache
Returns a cached file.- Overrides:
getFileFromCache
in classAbstractFileSystem
- Parameters:
name
- name to search for.- Returns:
- file object or null if not found.
-
removeFileFromCache
remove a cached file.- Overrides:
removeFileFromCache
in classAbstractFileSystem
- Parameters:
name
- The file name to remove.
-
toString
-