Package org.apache.commons.vfs2.provider
Class AbstractLayeredFileProvider
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractVfsContainer
-
- org.apache.commons.vfs2.provider.AbstractFileProvider
-
- org.apache.commons.vfs2.provider.AbstractLayeredFileProvider
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,FileProvider,VfsComponent
- Direct Known Subclasses:
CompressedFileFileProvider,TarFileProvider,ZipFileProvider
public abstract class AbstractLayeredFileProvider extends AbstractFileProvider
AFileProviderthat is layered on top of another, such as the contents of a ZIP or tar file.
-
-
Constructor Summary
Constructors Constructor Description AbstractLayeredFileProvider()Constructs a new instance for subclasses.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FileObjectcreateFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions)Creates a layered file system.protected abstract FileSystemdoCreateFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions)Creates a layered file system.FileObjectfindFile(FileObject baseFile, java.lang.String uri, FileSystemOptions fileSystemOptions)Locates a file object, by absolute URI.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileProvider
addFileSystem, close, closeFileSystem, findFileSystem, freeUnusedResources, getConfigBuilder, getFileNameParser, parseUri, setFileNameParser
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsContainer
addComponent, removeComponent
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.vfs2.provider.FileProvider
getCapabilities
-
-
-
-
Constructor Detail
-
AbstractLayeredFileProvider
public AbstractLayeredFileProvider()
Constructs a new instance for subclasses.
-
-
Method Detail
-
createFileSystem
public FileObject createFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions) throws FileSystemException
Creates a layered file system.- Specified by:
createFileSystemin interfaceFileProvider- Overrides:
createFileSystemin classAbstractFileProvider- Parameters:
scheme- The protocol to use.file- a FileObject.fileSystemOptions- Options to access the FileSystem.- Returns:
- A FileObject associated with the new FileSystem.
- Throws:
FileSystemException- if an error occurs.
-
doCreateFileSystem
protected abstract FileSystem doCreateFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions) throws FileSystemException
Creates a layered file system.This method is called if the file system is not cached.
- Parameters:
scheme- The URI scheme.file- The file to create the file system on top of.fileSystemOptions- options for new and underlying file systems.- Returns:
- The file system, never null. Might implement
VfsComponent. - Throws:
FileSystemException- if the file system cannot be created.
-
findFile
public FileObject findFile(FileObject baseFile, java.lang.String uri, FileSystemOptions fileSystemOptions) throws FileSystemException
Locates a file object, by absolute URI.- Parameters:
baseFile- The base FileObject.uri- The name of the file to locate.fileSystemOptions- The FileSystemOptions.- Returns:
- The FileObject if it is located, null otherwise.
- Throws:
FileSystemException- if an error occurs.
-
-