Class DefaultLocalFileProvider
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.provider.AbstractVfsContainer
-
- org.apache.commons.vfs2.provider.AbstractFileProvider
-
- org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider
-
- org.apache.commons.vfs2.provider.local.DefaultLocalFileProvider
-
- All Implemented Interfaces:
FileProvider
,LocalFileProvider
,VfsComponent
public class DefaultLocalFileProvider extends AbstractOriginatingFileProvider implements LocalFileProvider
A file system provider, which uses direct file access.
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Collection<Capability>
capabilities
The provider's capabilities.
-
Constructor Summary
Constructors Constructor Description DefaultLocalFileProvider()
Constructs a new provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileSystem
doCreateFileSystem(FileName name, FileSystemOptions fileSystemOptions)
Creates the filesystem.FileObject
findLocalFile(java.io.File file)
Finds a local file.FileObject
findLocalFile(java.lang.String name)
Finds a local file, from its local name.java.util.Collection<Capability>
getCapabilities()
Get the filesystem capabilities.
These are the same as on the filesystem, but available before the first filesystem was instanciated.boolean
isAbsoluteLocalName(java.lang.String name)
Determines if a name is an absolute file name.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider
findFile, findFile, getFileSystem
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileProvider
addFileSystem, close, closeFileSystem, createFileSystem, findFileSystem, freeUnusedResources, getConfigBuilder, getFileNameParser, parseUri, setFileNameParser
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsContainer
addComponent, removeComponent
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.vfs2.provider.FileProvider
createFileSystem, findFile, getConfigBuilder, parseUri
-
-
-
-
Field Detail
-
capabilities
public static final java.util.Collection<Capability> capabilities
The provider's capabilities.
-
-
Constructor Detail
-
DefaultLocalFileProvider
public DefaultLocalFileProvider()
Constructs a new provider.
-
-
Method Detail
-
isAbsoluteLocalName
public boolean isAbsoluteLocalName(java.lang.String name)
Determines if a name is an absolute file name.- Specified by:
isAbsoluteLocalName
in interfaceLocalFileProvider
- Parameters:
name
- The file name.- Returns:
- true if the name is absolute, false otherwise.
-
findLocalFile
public FileObject findLocalFile(java.lang.String name) throws FileSystemException
Finds a local file, from its local name.- Specified by:
findLocalFile
in interfaceLocalFileProvider
- Parameters:
name
- The name of the file to locate.- Returns:
- the located FileObject.
- Throws:
FileSystemException
- if an error occurs.
-
findLocalFile
public FileObject findLocalFile(java.io.File file) throws FileSystemException
Finds a local file.- Specified by:
findLocalFile
in interfaceLocalFileProvider
- Parameters:
file
- The File to locate.- Returns:
- the located FileObject.
- Throws:
FileSystemException
- if an error occurs.
-
doCreateFileSystem
protected FileSystem doCreateFileSystem(FileName name, FileSystemOptions fileSystemOptions) throws FileSystemException
Creates the filesystem.- Specified by:
doCreateFileSystem
in classAbstractOriginatingFileProvider
- Parameters:
name
- The name of the root file of the file system to create.fileSystemOptions
- The FileSystem options.- Returns:
- The FileSystem.
- Throws:
FileSystemException
- if an error occurs.
-
getCapabilities
public java.util.Collection<Capability> getCapabilities()
Description copied from interface:FileProvider
Get the filesystem capabilities.
These are the same as on the filesystem, but available before the first filesystem was instanciated.- Specified by:
getCapabilities
in interfaceFileProvider
- Returns:
- a Collection of the file systems Capabilities.
-
-