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
ConstructorsModifierConstructorDescriptionprotected
JarFileSystem
(AbstractFileName rootFileName, FileObject parentLayer, FileSystemOptions fileSystemOptions) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCapabilities
(Collection<Capability> caps) Returns the capabilities of this file system.protected ZipFile
createZipFile
(File file) Creates a Zip file.protected ZipFileObject
createZipFileObject
(AbstractFileName name, ZipEntry entry) Creates a new Zip file object.getAttribute
(String attrName) Retrieves the attribute with the specified name.protected ZipFile
Gets the zip file.Methods inherited from class org.apache.commons.vfs2.provider.zip.ZipFileSystem
createFile, doCloseCommunicationLink, getCharset, getFileFromCache, init, putFileToCache, removeFileFromCache, toString
Methods 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, setAttribute
Methods 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:
addCapabilities
in classZipFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
createZipFile
Description copied from class:ZipFileSystem
Creates a Zip file.- Overrides:
createZipFile
in 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:ZipFileSystem
Creates a new Zip file object.- Overrides:
createZipFileObject
in 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:
getAttribute
in interfaceFileSystem
- Overrides:
getAttribute
in 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:ZipFileSystem
Gets the zip file.- Overrides:
getZipFile
in classZipFileSystem
- Returns:
- the zip file.
- Throws:
FileSystemException
- if a file system error occurs.
-