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.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.jar.Attributes
attributes
-
Constructor Summary
Constructors Modifier Constructor Description protected
JarFileSystem(AbstractFileName rootName, FileObject file, FileSystemOptions fileSystemOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCapabilities(java.util.Collection<Capability> caps)
Returns the capabilities of this file system.protected java.util.zip.ZipFile
createZipFile(java.io.File file)
protected ZipFileObject
createZipFileObject(AbstractFileName name, java.util.zip.ZipEntry entry)
java.lang.Object
getAttribute(java.lang.String attrName)
Retrives the attribute with the specified name.(package private) java.lang.Object
getAttribute(java.util.jar.Attributes.Name attrName)
(package private) java.util.jar.Attributes
getAttributes()
protected java.util.zip.ZipFile
getZipFile()
(package private) java.util.jar.Attributes.Name
lookupName(java.lang.String attrName)
-
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 rootName, FileObject file, FileSystemOptions fileSystemOptions) throws FileSystemException
- Throws:
FileSystemException
-
-
Method Detail
-
createZipFile
protected java.util.zip.ZipFile createZipFile(java.io.File file) throws FileSystemException
- Overrides:
createZipFile
in classZipFileSystem
- Throws:
FileSystemException
-
createZipFileObject
protected ZipFileObject createZipFileObject(AbstractFileName name, java.util.zip.ZipEntry entry) throws FileSystemException
- Overrides:
createZipFileObject
in classZipFileSystem
- Throws:
FileSystemException
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Returns the capabilities of this file system.- Overrides:
addCapabilities
in classZipFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
getAttributes
java.util.jar.Attributes getAttributes() throws java.io.IOException
- Throws:
java.io.IOException
-
getAttribute
java.lang.Object getAttribute(java.util.jar.Attributes.Name attrName) throws FileSystemException
- Throws:
FileSystemException
-
lookupName
java.util.jar.Attributes.Name lookupName(java.lang.String attrName)
-
getAttribute
public java.lang.Object getAttribute(java.lang.String attrName) throws FileSystemException
Retrives 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 attiribute'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
- Overrides:
getZipFile
in classZipFileSystem
- Throws:
FileSystemException
-
-