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:
java.io.Closeable,java.lang.AutoCloseable,FileSystem,VfsComponent
public class JarFileSystem extends ZipFileSystem
A read-only file system for Jar files.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJarFileSystem(AbstractFileName rootFileName, FileObject parentLayer, FileSystemOptions fileSystemOptions)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCapabilities(java.util.Collection<Capability> caps)Returns the capabilities of this file system.protected java.util.zip.ZipFilecreateZipFile(java.io.File file)Creates a Zip file.protected ZipFileObjectcreateZipFileObject(AbstractFileName name, java.util.zip.ZipEntry entry)Creates a new Zip file object.java.lang.ObjectgetAttribute(java.lang.String attrName)Retrieves the attribute with the specified name.protected java.util.zip.ZipFilegetZipFile()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 Detail
-
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 Detail
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Returns the capabilities of this file system.- Overrides:
addCapabilitiesin classZipFileSystem- Parameters:
caps- collections of Capabilities, can be immutable.
-
createZipFile
protected java.util.zip.ZipFile createZipFile(java.io.File file) throws FileSystemException
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, java.util.zip.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
public java.lang.Object getAttribute(java.lang.String attrName) throws FileSystemException
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:
FileContent.getAttribute(java.lang.String)
-
getZipFile
protected java.util.zip.ZipFile getZipFile() throws FileSystemException
Description copied from class:ZipFileSystemGets the zip file.- Overrides:
getZipFilein classZipFileSystem- Returns:
- the zip file.
- Throws:
FileSystemException- if a file system error occurs.
-
-