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:
Closeable, AutoCloseable, FileProvider, VfsComponent
- Direct Known Subclasses:
CompressedFileFileProvider, TarFileProvider, ZipFileProvider
A
FileProvider that is layered on top of another, such as the contents of a ZIP or tar file.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFileSystem(String scheme, FileObject file, FileSystemOptions fileSystemOptions) Creates a layered file system.protected abstract FileSystemdoCreateFileSystem(String scheme, FileObject file, FileSystemOptions fileSystemOptions) Creates a layered file system.findFile(FileObject baseFile, String uri, FileSystemOptions fileSystemOptions) Locates a file object, by absolute URI.Methods inherited from class AbstractFileProvider
addFileSystem, close, closeFileSystem, findFileSystem, freeUnusedResources, getConfigBuilder, getFileNameParser, parseUri, setFileNameParserMethods inherited from class AbstractVfsContainer
addComponent, removeComponentMethods inherited from class AbstractVfsComponent
getContext, getLogger, init, setContext, setLoggerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface FileProvider
getCapabilities
-
Constructor Details
-
AbstractLayeredFileProvider
public AbstractLayeredFileProvider()Constructs a new instance for subclasses.
-
-
Method Details
-
createFileSystem
public FileObject createFileSystem(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(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, 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.
-