| org.apache.commons.vfs.FileSystemManager
All known Subclasses: org.apache.commons.vfs.impl.DefaultFileSystemManager,
FileSystemManager | public interface FileSystemManager (Code) | | A FileSystemManager manages a set of file systems. This interface is
used to locate a
FileObject by name from one of those file systems.
To locate a
FileObject , use one of the resolveFile()
methods.
A file system manager can recognise several types of file names:
Absolute URI. These must start with a scheme, such as
file: or ftp: , followed by a scheme dependent
file name. Some examples:
file:/c:/somefile
ftp://somewhere.org/somefile
Absolute local file name. For example,
/home/someuser/a-file or c:\dir\somefile.html .
Elements in the name can be separated using any of the following
characters: / , \ , or the native file separator
character. For example, the following file names are the same:
c:\somedir\somefile.xml
c:/somedir/somefile.xml
Relative path. For example: ../somefile or
somedir/file.txt . The file system manager resolves relative
paths against its base file. Elements in the relative path can be
separated using / , \ , or file system specific
separator characters. Relative paths may also contain .. and
. elements. See
FileObject.resolveFile for more
details.
author: Adam Murdoch version: $Revision: 484648 $ $Date: 2006-12-08 08:18:36 -0800 (Fri, 08 Dec 2006) $ |
Method Summary | |
public void | addOperationProvider(String scheme, FileOperationProvider operationProvider) Adds the specified FileOperationProvider for the specified scheme. | public void | addOperationProvider(String[] schemes, FileOperationProvider operationProvider) | public boolean | canCreateFileSystem(FileObject file) Determines if a layered file system can be created for a given file. | public void | closeFileSystem(FileSystem filesystem) Closes the given filesystem.
If you use VFS as singleton it is VERY dangerous to call this method. | public FileObject | createFileSystem(String provider, FileObject file) Creates a layered file system. | public FileObject | createFileSystem(FileObject file) Creates a layered file system. | public FileObject | createVirtualFileSystem(String rootUri) Creates an empty virtual file system. | public FileObject | createVirtualFileSystem(FileObject rootFile) Creates a virtual file system. | public FileObject | getBaseFile() Returns the base file used to resolve relative paths. | public CacheStrategy | getCacheStrategy() | public FileContentInfoFactory | getFileContentInfoFactory() | public Class | getFileObjectDecorator() | public Constructor | getFileObjectDecoratorConst() The constructor associated to the fileObjectDecorator. | public FileSystemConfigBuilder | getFileSystemConfigBuilder(String scheme) | public FilesCache | getFilesCache() Get the cache used to cache fileobjects. | public FileOperationProvider[] | getOperationProviders(String scheme) Parameters: scheme - the scheme for wich we want to get the list af registered providers. | public Collection | getProviderCapabilities(String scheme) Get the capabilities for a given scheme. | public String[] | getSchemes() Get the schemes currently available. | public URLStreamHandlerFactory | getURLStreamHandlerFactory() Returns a streamhandler factory to enable URL lookup using this
FileSystemManager. | public FileObject | resolveFile(String name) Locates a file by name. | public FileObject | resolveFile(String name, FileSystemOptions fileSystemOptions) Locates a file by name. | public FileObject | resolveFile(FileObject baseFile, String name) Locates a file by name. | public FileObject | resolveFile(File baseFile, String name) Locates a file by name. | public FileName | resolveName(FileName root, String name) Resolves a name, relative to this file name. | public FileName | resolveName(FileName root, String name, NameScope scope) Resolves a name, relative to the "root" file name. | public FileName | resolveURI(String uri) | public void | setLogger(Log log) Sets the logger to use. | public FileObject | toFileObject(File file) Converts a local file into a
FileObject .
Parameters: file - The file to convert. |
addOperationProvider | public void addOperationProvider(String scheme, FileOperationProvider operationProvider) throws FileSystemException(Code) | | Adds the specified FileOperationProvider for the specified scheme.
Several FileOperationProvider's might be registered for the same scheme.
For example, for "file" scheme we can register SvnWsOperationProvider and
CvsOperationProvider.
Parameters: scheme - Parameters: operationProvider - throws: FileSystemException - |
canCreateFileSystem | public boolean canCreateFileSystem(FileObject file) throws FileSystemException(Code) | | Determines if a layered file system can be created for a given file.
Parameters: file - The file to check for. |
closeFileSystem | public void closeFileSystem(FileSystem filesystem)(Code) | | Closes the given filesystem.
If you use VFS as singleton it is VERY dangerous to call this method.
|
createFileSystem | public FileObject createFileSystem(String provider, FileObject file) throws FileSystemException(Code) | | Creates a layered file system. A layered file system is a file system
that is created from the contents of a file, such as a zip or tar file.
Parameters: provider - The name of the file system provider to use. This nameis the same as the scheme used in URI to identify the provider. Parameters: file - The file to use to create the file system. The root file of the new file system. throws: FileSystemException - On error creating the file system. |
createFileSystem | public FileObject createFileSystem(FileObject file) throws FileSystemException(Code) | | Creates a layered file system. A layered file system is a file system
that is created from the contents of a file, such as a zip or tar file.
Parameters: file - The file to use to create the file system. The root file of the new file system. throws: FileSystemException - On error creating the file system. |
createVirtualFileSystem | public FileObject createVirtualFileSystem(String rootUri) throws FileSystemException(Code) | | Creates an empty virtual file system. Can be populated by adding
junctions to it.
Parameters: rootUri - The root URI to use for the new file system. Can be null. The root file of the new file system. |
createVirtualFileSystem | public FileObject createVirtualFileSystem(FileObject rootFile) throws FileSystemException(Code) | | Creates a virtual file system. The file system will contain a junction
at the fs root to the supplied root file.
Parameters: rootFile - The root file to backs the file system. The root of the new file system. |
getFileContentInfoFactory | public FileContentInfoFactory getFileContentInfoFactory()(Code) | | The class to use to determine the content-type (mime-type)
|
getFileObjectDecorator | public Class getFileObjectDecorator()(Code) | | Get the file object decorator used
|
getFileObjectDecoratorConst | public Constructor getFileObjectDecoratorConst()(Code) | | The constructor associated to the fileObjectDecorator.
We cache it here for performance reasons.
|
getFilesCache | public FilesCache getFilesCache()(Code) | | Get the cache used to cache fileobjects.
|
getOperationProviders | public FileOperationProvider[] getOperationProviders(String scheme) throws FileSystemException(Code) | | Parameters: scheme - the scheme for wich we want to get the list af registered providers. the registered FileOperationProviders for the specified scheme.If there were no providers registered for the scheme, it returns null. throws: FileSystemException - |
getSchemes | public String[] getSchemes()(Code) | | Get the schemes currently available.
|
getURLStreamHandlerFactory | public URLStreamHandlerFactory getURLStreamHandlerFactory()(Code) | | Returns a streamhandler factory to enable URL lookup using this
FileSystemManager.
|
resolveFile | public FileObject resolveFile(String name, FileSystemOptions fileSystemOptions) throws FileSystemException(Code) | | Locates a file by name. Equivalent to calling
resolveFile(uri, getBaseName()) .
Parameters: name - The name of the file. Parameters: fileSystemOptions - The FileSystemOptions used for FileSystem creation The file. Never returns null. throws: FileSystemException - On error parsing the file name. |
resolveFile | public FileObject resolveFile(FileObject baseFile, String name) throws FileSystemException(Code) | | Locates a file by name. The name is resolved as described
above. That is, the name can be either
an absolute URI, an absolute file name, or a relative path to
be resolved against baseFile .
Note that the file does not have to exist when this method is called.
Parameters: name - The name of the file. Parameters: baseFile - The base file to use to resolve relative paths.May be null. The file. Never returns null. throws: FileSystemException - On error parsing the file name. |
resolveName | public FileName resolveName(FileName root, String name) throws FileSystemException(Code) | | Resolves a name, relative to this file name. Equivalent to calling
resolveName( path, NameScope.FILE_SYSTEM ) .
Parameters: root - the base filename Parameters: name - The name to resolve. A FileName object representing the resolved file name. throws: FileSystemException - If the name is invalid. |
setLogger | public void setLogger(Log log)(Code) | | Sets the logger to use.
|
|
|