Package org.apache.commons.vfs2.provider
Interface VfsComponentContext
-
public interface VfsComponentContext
Allows VFS components to access the services they need, such as the file replicator. A VFS component is supplied with a context as part of its initialization.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FileSystemManagergetFileSystemManager()Gets the file system manager for the current context.FileReplicatorgetReplicator()Gets a file replicator for the provider to use.TemporaryFileStoregetTemporaryFileStore()Gets a temporary file store for the provider to use.FileNameparseURI(java.lang.String uri)Parses a URI into a FileName.FileObjectresolveFile(java.lang.String name, FileSystemOptions fileSystemOptions)Resolves a file by name.FileObjectresolveFile(FileObject baseFile, java.lang.String name, FileSystemOptions fileSystemOptions)Resolves a file by name.FileObjecttoFileObject(java.io.File file)Returns aFileObjectfor a local file.
-
-
-
Method Detail
-
getFileSystemManager
FileSystemManager getFileSystemManager()
Gets the file system manager for the current context.- Returns:
- the file system manager
-
getReplicator
FileReplicator getReplicator() throws FileSystemException
Gets a file replicator for the provider to use.- Returns:
- The FileReplicator.
- Throws:
FileSystemException- if an error occurs.
-
getTemporaryFileStore
TemporaryFileStore getTemporaryFileStore() throws FileSystemException
Gets a temporary file store for the provider to use.- Returns:
- The TemporaryFileStore.
- Throws:
FileSystemException- if an error occurs.
-
parseURI
FileName parseURI(java.lang.String uri) throws FileSystemException
Parses a URI into a FileName.- Parameters:
uri- The URI String.- Returns:
- The FileName.
- Throws:
FileSystemException- if an error occurs.
-
resolveFile
FileObject resolveFile(FileObject baseFile, java.lang.String name, FileSystemOptions fileSystemOptions) throws FileSystemException
Resolves a file by name. SeeFileSystemManager.resolveFile(FileObject, String)for a description of how this works.- Parameters:
baseFile- The base FileObject.name- The name of the file to locate.fileSystemOptions- The FileSystemOptions.- Returns:
- The FileObject for the located file.
- Throws:
FileSystemException- if an error occurs.
-
resolveFile
FileObject resolveFile(java.lang.String name, FileSystemOptions fileSystemOptions) throws FileSystemException
Resolves a file by name. SeeFileSystemManager.resolveFile( String)for a description of how this works.- Parameters:
name- The name of the file to locate.fileSystemOptions- The FileSystemOptions.- Returns:
- The FileObject for the located file.
- Throws:
FileSystemException- if an error occurs.
-
toFileObject
FileObject toFileObject(java.io.File file) throws FileSystemException
Returns aFileObjectfor a local file.- Parameters:
file- The File to convert to a FileObject.- Returns:
- the FileObject.
- Throws:
FileSystemException- if an error occurs.
-
-