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:
FileProvider
,VfsComponent
- Direct Known Subclasses:
CompressedFileFileProvider
,TarFileProvider
,ZipFileProvider
public abstract class AbstractLayeredFileProvider extends AbstractFileProvider
AFileProvider
that is layered on top of another, such as the contents of a zip or tar file.
-
-
Constructor Summary
Constructors Constructor Description AbstractLayeredFileProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FileObject
createFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions)
Creates a layered file system.protected abstract FileSystem
doCreateFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions)
Creates a layered file system.FileObject
findFile(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()
-
-
Method Detail
-
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.
-
createFileSystem
public FileObject createFileSystem(java.lang.String scheme, FileObject file, FileSystemOptions fileSystemOptions) throws FileSystemException
Creates a layered file system.- Specified by:
createFileSystem
in interfaceFileProvider
- Overrides:
createFileSystem
in 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.
-
-