Class JarFileSystem
java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractFileSystem
org.apache.commons.vfs2.provider.zip.ZipFileSystem
org.apache.commons.vfs2.provider.jar.JarFileSystem
- All Implemented Interfaces:
Closeable,AutoCloseable,FileSystem,VfsComponent
A read-only file system for Jar files.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJarFileSystem(AbstractFileName rootFileName, FileObject parentLayer, FileSystemOptions fileSystemOptions) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCapabilities(Collection<Capability> caps) Returns the capabilities of this file system.protected ZipFilecreateZipFile(File file) Creates a Zip file.protected ZipFileObjectcreateZipFileObject(AbstractFileName name, ZipEntry entry) Creates a new Zip file object.getAttribute(String attrName) Retrieves the attribute with the specified name.protected ZipFileGets the zip file.Methods inherited from class org.apache.commons.vfs2.provider.zip.ZipFileSystem
createFile, doCloseCommunicationLink, getCharset, getFileFromCache, init, putFileToCache, removeFileFromCache, toStringMethods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addJunction, addListener, close, closeCommunicationLink, decorateFileObject, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, isOpen, isReleaseable, notifyAllStreamsClosed, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttributeMethods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
Constructor Details
-
JarFileSystem
protected JarFileSystem(AbstractFileName rootFileName, FileObject parentLayer, FileSystemOptions fileSystemOptions) throws FileSystemException Constructs a new instance.- Parameters:
rootFileName- The root file name of this file system.parentLayer- The parent layer of this file system.fileSystemOptions- Options to build this file system.- Throws:
FileSystemException- If the parent layer does not exist, or on error replicating the file.
-
-
Method Details
-
addCapabilities
Returns the capabilities of this file system.- Overrides:
addCapabilitiesin classZipFileSystem- Parameters:
caps- collections of Capabilities, can be immutable.
-
createZipFile
Description copied from class:ZipFileSystemCreates a Zip file.- Overrides:
createZipFilein classZipFileSystem- Parameters:
file- the underlying file.- Returns:
- a Zip file.
- Throws:
FileSystemException- if a file system error occurs.
-
createZipFileObject
protected ZipFileObject createZipFileObject(AbstractFileName name, ZipEntry entry) throws FileSystemException Description copied from class:ZipFileSystemCreates a new Zip file object.- Overrides:
createZipFileObjectin classZipFileSystem- Parameters:
name- the underlying file.entry- the Zip entry.- Returns:
- a new ZipFileObject.
- Throws:
FileSystemException- if a file system error occurs.
-
getAttribute
Retrieves the attribute with the specified name. The default implementation simply throws an exception.- Specified by:
getAttributein interfaceFileSystem- Overrides:
getAttributein classAbstractFileSystem- Parameters:
attrName- The attribute's name.- Returns:
- The value of the attribute.
- Throws:
FileSystemException- if an error occurs.- See Also:
-
getZipFile
Description copied from class:ZipFileSystemGets the zip file.- Overrides:
getZipFilein classZipFileSystem- Returns:
- the zip file.
- Throws:
FileSystemException- if a file system error occurs.
-