public class VFSFileSystemManager
extends org.apache.commons.vfs2.impl.StandardFileSystemManager
FileSystemManager
managing protocol options etc.
Main reason for this class is the possiblity to install options for each of the schemes
which are used by the overwritten resolve()
methods automatically. The original
FileSystemManager
implementations also lack support for various functions
as to mention the direct removal of already installed schemes.
Constructor and Description |
---|
VFSFileSystemManager()
Constructor method using the default configuration.
|
VFSFileSystemManager(URL configuri)
Constructor method using the given configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addConnection(VFSConnection vfsconn)
Adds a new network connections for this manager.
|
VFSConnection |
getBestConnection(String uri)
Searches the configured connections for an appropriate instance (scheme, host, ...).
|
Vector<VFSConnection> |
getConnections()
Provides the currently configured network connections for this manager.
|
org.apache.commons.vfs2.provider.FileProvider |
getProvider(String scheme)
Provides the provider for the given scheme/protocol.
|
Map |
getProviders()
Provides the cache with scheme providers.
|
org.apache.commons.vfs2.operations.FileOperationProvider |
removeOperationProvider(String protocol)
Removes the
FileOperationProvider for the specified scheme. |
org.apache.commons.vfs2.FileObject |
resolveFile(org.apache.commons.vfs2.FileObject baseFile,
String uri)
Resolves a URI, relative to a base file.
|
org.apache.commons.vfs2.FileObject |
resolveFile(org.apache.commons.vfs2.FileObject baseFile,
String uri,
VFSConnection vfsconn)
Resolves a URI, relative to a base file.
|
org.apache.commons.vfs2.FileObject |
resolveFile(File baseFile,
String uri)
Resolves a URI, relative to a base file.
|
org.apache.commons.vfs2.FileObject |
resolveFile(File baseFile,
String uri,
VFSConnection vfsconn)
Resolves a URI, relative to a base file.
|
org.apache.commons.vfs2.FileObject |
resolveFile(String uri)
Locates a file by URI.
|
org.apache.commons.vfs2.FileObject |
resolveFile(String uri,
org.apache.commons.vfs2.FileSystemOptions options)
Locates a file by URI and file system options.
|
org.apache.commons.vfs2.FileObject |
resolveFile(String uri,
org.apache.commons.vfs2.FileSystemOptions options,
VFSConnection vfsconn)
Locates a file by URI.
|
org.apache.commons.vfs2.FileObject |
resolveFile(String uri,
VFSConnection vfsconn)
Locates a file by URI.
|
void |
setConnections(Vector<VFSConnection> connections)
Sets the currently configured network connections for this manager.
|
init, setClassLoader, setConfiguration, setConfiguration
_closeFileSystem, addExtensionMap, addMimeTypeMap, addOperationProvider, addOperationProvider, addProvider, addProvider, canCreateFileSystem, close, closeFileSystem, createFileSystem, createFileSystem, createVirtualFileSystem, createVirtualFileSystem, freeUnusedResources, getBaseFile, getCacheStrategy, getFileContentInfoFactory, getFileObjectDecorator, getFileObjectDecoratorConst, getFilesCache, getFileSystemConfigBuilder, getOperationProviders, getProviderCapabilities, getReplicator, getSchemes, getTemporaryFileStore, getURLStreamHandlerFactory, hasProvider, removeProvider, resolveFile, resolveFile, resolveFile, resolveName, resolveName, resolveURI, setBaseFile, setBaseFile, setCacheStrategy, setDefaultProvider, setFileContentInfoFactory, setFileObjectDecorator, setFilesCache, setLogger, setReplicator, setTemporaryFileStore, toFileObject
public VFSFileSystemManager()
public VFSFileSystemManager(URL configuri)
configuri
- The descriptor resource pathNullPointerException
- If a parameter is null
public Map getProviders()
null
public org.apache.commons.vfs2.provider.FileProvider getProvider(String scheme)
scheme
- The protocol like "sftp"null
public org.apache.commons.vfs2.operations.FileOperationProvider removeOperationProvider(String protocol)
FileOperationProvider
for the specified scheme.
Another alternative would be to specify a modified "providers.xml" for the 2nd constructor.
The original FileSystemManager
lacks this functionality of directly removing
already installed providers.
protocol
- The VFS scheme like "sftp"null
public org.apache.commons.vfs2.FileObject resolveFile(String uri) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
resolveFile
in interface org.apache.commons.vfs2.FileSystemManager
resolveFile
in class org.apache.commons.vfs2.impl.DefaultFileSystemManager
uri
- The URI to resolveorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(String uri, VFSConnection vfsconn) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
uri
- The URI to resolvevfsconn
- The connection with optionsorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(String uri, org.apache.commons.vfs2.FileSystemOptions options) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
resolveFile
in interface org.apache.commons.vfs2.FileSystemManager
resolveFile
in class org.apache.commons.vfs2.impl.DefaultFileSystemManager
uri
- The URI to resolveoptions
- The file system optionsorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(String uri, org.apache.commons.vfs2.FileSystemOptions options, VFSConnection vfsconn) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
uri
- The URI to resolveoptions
- The file system optionsvfsconn
- The connection with optionsorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(File baseFile, String uri) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
resolveFile
in interface org.apache.commons.vfs2.FileSystemManager
resolveFile
in class org.apache.commons.vfs2.impl.DefaultFileSystemManager
baseFile
- The base fileuri
- The URI to resolveorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(File baseFile, String uri, VFSConnection vfsconn) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
baseFile
- The base fileuri
- The URI to resolvevfsconn
- The connection with optionsorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(org.apache.commons.vfs2.FileObject baseFile, String uri) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
resolveFile
in interface org.apache.commons.vfs2.FileSystemManager
resolveFile
in class org.apache.commons.vfs2.impl.DefaultFileSystemManager
baseFile
- The base fileuri
- The URI to resolveorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic org.apache.commons.vfs2.FileObject resolveFile(org.apache.commons.vfs2.FileObject baseFile, String uri, VFSConnection vfsconn) throws org.apache.commons.vfs2.FileSystemException
If installed the file system options e.g. for schemes like "sftp" are applied here.
baseFile
- The base fileuri
- The URI to resolvevfsconn
- The connection with optionsorg.apache.commons.vfs2.FileSystemException
- If an error occurspublic Vector<VFSConnection> getConnections()
public void setConnections(Vector<VFSConnection> connections)
connections
- The connectionsNullPointerException
- If a parameter is null
public void addConnection(VFSConnection vfsconn)
vfsconn
- The connectionNullPointerException
- If a parameter is null
public VFSConnection getBestConnection(String uri)
This way it is possible to access files on servers with special params like passive FTP by a simple URL which may be specified on the command line (and which lacks the connection options).
uri
- The network file to checknull
Copyright © 2005-2024 Leisenfels GmbH. All rights reserved.