Package org.apache.commons.vfs2.provider
Class AbstractFileProvider
java.lang.Object
org.apache.commons.vfs2.provider.AbstractVfsComponent
org.apache.commons.vfs2.provider.AbstractVfsContainer
org.apache.commons.vfs2.provider.AbstractFileProvider
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- FileProvider,- VfsComponent
- Direct Known Subclasses:
- AbstractLayeredFileProvider,- AbstractOriginatingFileProvider,- CompositeFileProvider,- ResourceFileProvider,- TemporaryFileProvider,- UrlFileProvider
A partial 
FileProvider implementation. Takes care of managing the file systems created by the provider.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaddFileSystem(Comparable<?> key, FileSystem fs) Adds a file system to those cached by this provider.voidclose()Closes the file systems created by this provider.voidcloseFileSystem(FileSystem fileSystem) Closes the FileSystem.createFileSystem(String scheme, FileObject file, FileSystemOptions fileSystemOptions) Creates a layered file system.protected FileSystemfindFileSystem(Comparable<?> key, FileSystemOptions fileSystemOptions) Locates a cached file system.voidFrees unused resources.Gets the FileSystemConfigBuilder.protected FileNameParserGets the file name parser.Parses an absolute URI.protected voidsetFileNameParser(FileNameParser parser) Sets the file name parser.Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsContaineraddComponent, removeComponentMethods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponentgetContext, getLogger, init, setContext, setLoggerMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.vfs2.provider.FileProviderfindFile, getCapabilities
- 
Constructor Details- 
AbstractFileProviderpublic AbstractFileProvider()Constructs a new instance for subclasses.
 
- 
- 
Method Details- 
addFileSystemAdds a file system to those cached by this provider.The file system may implement VfsComponent, in which case it is initialized.- Parameters:
- key- The root file of the file system, part of the cache key.
- fs- the file system to add.
- Throws:
- FileSystemException- if any error occurs.
 
- 
closeCloses the file systems created by this provider.- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein interface- VfsComponent
- Overrides:
- closein class- AbstractVfsContainer
 
- 
closeFileSystemCloses the FileSystem.- Parameters:
- fileSystem- The FileSystem to close.
 
- 
createFileSystempublic FileObject createFileSystem(String scheme, FileObject file, FileSystemOptions fileSystemOptions) throws FileSystemException Creates a layered file system. This method throws a 'not supported' exception.- Specified by:
- createFileSystemin interface- FileProvider
- Parameters:
- scheme- The protocol to use to access the file.
- file- a FileObject.
- fileSystemOptions- Options to the file system.
- Returns:
- A FileObject associated with the new FileSystem.
- Throws:
- FileSystemException- if an error occurs.
 
- 
findFileSystemLocates a cached file system.- Parameters:
- key- The root file of the file system, part of the cache key.
- fileSystemOptions- file system options the file system instance must have, may be null.
- Returns:
- The file system instance, or null if it is not cached.
 
- 
freeUnusedResourcesFrees unused resources.
- 
getConfigBuilderGets the FileSystemConfigBuilder.- Specified by:
- getConfigBuilderin interface- FileProvider
- Returns:
- the FileSystemConfigBuilder.
 
- 
getFileNameParserGets the file name parser.- Returns:
- the file name parser.
 
- 
parseUriParses an absolute URI.- Specified by:
- parseUriin interface- FileProvider
- Parameters:
- base- The base file - if null the- urineeds to be absolute
- uri- The URI to parse.
- Returns:
- The FileName.
- Throws:
- FileSystemException- if an error occurs.
 
- 
setFileNameParserSets the file name parser.- Parameters:
- parser- a file name parser.
 
 
-