Package org.apache.commons.vfs2.impl
Class DefaultVfsComponentContext
- java.lang.Object
-
- org.apache.commons.vfs2.impl.DefaultVfsComponentContext
-
- All Implemented Interfaces:
VfsComponentContext
final class DefaultVfsComponentContext extends java.lang.Object implements VfsComponentContext
The default context implementation.
-
-
Field Summary
Fields Modifier and Type Field Description private DefaultFileSystemManager
manager
-
Constructor Summary
Constructors Constructor Description DefaultVfsComponentContext(DefaultFileSystemManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSystemManager
getFileSystemManager()
Returns the file system manager for the current contextFileReplicator
getReplicator()
Locates a file replicator for the provider to use.TemporaryFileStore
getTemporaryFileStore()
Locates a temporary file store for the provider to use.FileName
parseURI(java.lang.String uri)
Parses a URI into a FileName.FileObject
resolveFile(java.lang.String name, FileSystemOptions fileSystemOptions)
Locate a file by name.FileObject
resolveFile(FileObject baseFile, java.lang.String name, FileSystemOptions fileSystemOptions)
Locate a file by name.FileObject
toFileObject(java.io.File file)
Returns aFileObject
for a local file.
-
-
-
Field Detail
-
manager
private final DefaultFileSystemManager manager
-
-
Constructor Detail
-
DefaultVfsComponentContext
public DefaultVfsComponentContext(DefaultFileSystemManager manager)
-
-
Method Detail
-
resolveFile
public FileObject resolveFile(FileObject baseFile, java.lang.String name, FileSystemOptions fileSystemOptions) throws FileSystemException
Locate a file by name.- Specified by:
resolveFile
in interfaceVfsComponentContext
- 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
public FileObject resolveFile(java.lang.String name, FileSystemOptions fileSystemOptions) throws FileSystemException
Locate a file by name.- Specified by:
resolveFile
in interfaceVfsComponentContext
- 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.
-
parseURI
public FileName parseURI(java.lang.String uri) throws FileSystemException
Description copied from interface:VfsComponentContext
Parses a URI into a FileName.- Specified by:
parseURI
in interfaceVfsComponentContext
- Parameters:
uri
- The URI String.- Returns:
- The FileName.
- Throws:
FileSystemException
- if an error occurs.
-
toFileObject
public FileObject toFileObject(java.io.File file) throws FileSystemException
Returns aFileObject
for a local file.- Specified by:
toFileObject
in interfaceVfsComponentContext
- Parameters:
file
- The File to convert to a FileObject.- Returns:
- the FileObject.
- Throws:
FileSystemException
- if an error occurs.
-
getReplicator
public FileReplicator getReplicator() throws FileSystemException
Locates a file replicator for the provider to use.- Specified by:
getReplicator
in interfaceVfsComponentContext
- Returns:
- The FileReplicator.
- Throws:
FileSystemException
- if an error occurs.
-
getTemporaryFileStore
public TemporaryFileStore getTemporaryFileStore() throws FileSystemException
Locates a temporary file store for the provider to use.- Specified by:
getTemporaryFileStore
in interfaceVfsComponentContext
- Returns:
- The TemporaryFileStore.
- Throws:
FileSystemException
- if an error occurs.
-
getFileSystemManager
public FileSystemManager getFileSystemManager()
Returns the file system manager for the current context- Specified by:
getFileSystemManager
in interfaceVfsComponentContext
- Returns:
- the file system manager
-
-