Class TarFileSystem
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractFileSystem
-
- org.apache.commons.vfs2.provider.tar.TarFileSystem
-
- All Implemented Interfaces:
FileSystem
,VfsComponent
public class TarFileSystem extends AbstractFileSystem
A read-only file system for Tar files.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TarFileSystem(AbstractFileName rootName, FileObject parentLayer, 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 FileObject
createFile(AbstractFileName name)
Creates a file object.protected org.apache.commons.compress.archivers.tar.TarArchiveInputStream
createTarFile(java.io.File file)
protected TarFileObject
createTarFileObject(AbstractFileName name, org.apache.commons.compress.archivers.tar.TarArchiveEntry entry)
protected void
doCloseCommunicationLink()
Close the underlying link used to access the filesjava.io.InputStream
getInputStream(org.apache.commons.compress.archivers.tar.TarArchiveEntry entry)
protected org.apache.commons.compress.archivers.tar.TarArchiveInputStream
getTarFile()
void
init()
Initializes this component.protected void
resetTarFile()
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileSystem
addJunction, addListener, close, closeCommunicationLink, decorateFileObject, doReplicateFile, fireFileChanged, fireFileCreated, fireFileDeleted, getAttribute, getFileFromCache, getFileSystemManager, getFileSystemOptions, getLastModTimeAccuracy, getParentLayer, getRoot, getRootName, getRootURI, hasCapability, isOpen, isReleaseable, notifyAllStreamsClosed, putFileToCache, removeFileFromCache, removeJunction, removeListener, replicateFile, resolveFile, resolveFile, setAttribute
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, setContext, setLogger
-
-
-
-
Constructor Detail
-
TarFileSystem
protected TarFileSystem(AbstractFileName rootName, FileObject parentLayer, FileSystemOptions fileSystemOptions) throws FileSystemException
- Throws:
FileSystemException
-
-
Method Detail
-
init
public void init() throws FileSystemException
Description copied from class:AbstractFileSystem
Initializes this component.- Specified by:
init
in interfaceVfsComponent
- Overrides:
init
in classAbstractFileSystem
- Throws:
FileSystemException
- if an error occurs.
-
getInputStream
public java.io.InputStream getInputStream(org.apache.commons.compress.archivers.tar.TarArchiveEntry entry) throws FileSystemException
- Throws:
FileSystemException
-
resetTarFile
protected void resetTarFile() throws FileSystemException
- Throws:
FileSystemException
-
getTarFile
protected org.apache.commons.compress.archivers.tar.TarArchiveInputStream getTarFile() throws FileSystemException
- Throws:
FileSystemException
-
createTarFileObject
protected TarFileObject createTarFileObject(AbstractFileName name, org.apache.commons.compress.archivers.tar.TarArchiveEntry entry) throws FileSystemException
- Throws:
FileSystemException
-
createTarFile
protected org.apache.commons.compress.archivers.tar.TarArchiveInputStream createTarFile(java.io.File file) throws FileSystemException
- Throws:
FileSystemException
-
doCloseCommunicationLink
protected void doCloseCommunicationLink()
Description copied from class:AbstractFileSystem
Close the underlying link used to access the files- Overrides:
doCloseCommunicationLink
in classAbstractFileSystem
-
addCapabilities
protected void addCapabilities(java.util.Collection<Capability> caps)
Returns the capabilities of this file system.- Specified by:
addCapabilities
in classAbstractFileSystem
- Parameters:
caps
- collections of Capabilities, can be immutable.
-
createFile
protected FileObject createFile(AbstractFileName name) throws FileSystemException
Creates a file object.- Specified by:
createFile
in classAbstractFileSystem
- Parameters:
name
- name referencing the new file.- Returns:
- new created FileObject.
- Throws:
FileSystemException
-
-