org.apache.commons.vfs2.provider
Class AbstractOriginatingFileProvider

java.lang.Object
  extended by org.apache.commons.vfs2.provider.AbstractVfsComponent
      extended by org.apache.commons.vfs2.provider.AbstractVfsContainer
          extended by org.apache.commons.vfs2.provider.AbstractFileProvider
              extended by org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider
All Implemented Interfaces:
FileProvider, VfsComponent
Direct Known Subclasses:
DefaultLocalFileProvider, FtpFileProvider, HttpFileProvider, RamFileProvider, SftpFileProvider

public abstract class AbstractOriginatingFileProvider
extends AbstractFileProvider

A FileProvider that handles physical files, such as the files in a local fs, or on an FTP server. An originating file system cannot be layered on top of another file system.

Author:
Commons VFS team

Constructor Summary
AbstractOriginatingFileProvider()
           
 
Method Summary
protected abstract  FileSystem doCreateFileSystem(FileName rootName, FileSystemOptions fileSystemOptions)
          Creates a FileSystem.
protected  FileObject findFile(FileName name, FileSystemOptions fileSystemOptions)
          Locates a file from its parsed URI.
 FileObject findFile(FileObject baseFile, java.lang.String uri, FileSystemOptions fileSystemOptions)
          Locates a file object, by absolute URI.
protected  FileSystem getFileSystem(FileName rootName, FileSystemOptions fileSystemOptions)
          Returns the FileSystem associated with the specified root.
 
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
getCapabilities
 

Constructor Detail

AbstractOriginatingFileProvider

public AbstractOriginatingFileProvider()
Method Detail

findFile

public FileObject findFile(FileObject baseFile,
                           java.lang.String uri,
                           FileSystemOptions fileSystemOptions)
                    throws FileSystemException
Locates a file object, by absolute URI.

Parameters:
baseFile - The base file object.
uri - The URI of the file to locate
fileSystemOptions - The FileSystem options.
Returns:
The located FileObject
Throws:
FileSystemException - if an error occurs.

findFile

protected FileObject findFile(FileName name,
                              FileSystemOptions fileSystemOptions)
                       throws FileSystemException
Locates a file from its parsed URI.

Parameters:
name - The file name.
fileSystemOptions - FileSystem options.
Returns:
A FileObject associated with the file.
Throws:
FileSystemException - if an error occurs.

getFileSystem

protected FileSystem getFileSystem(FileName rootName,
                                   FileSystemOptions fileSystemOptions)
                            throws FileSystemException
Returns the FileSystem associated with the specified root.

Parameters:
rootName - The root path.
fileSystemOptions - The FileSystem options.
Returns:
The FileSystem.
Throws:
FileSystemException - if an error occurs.
Since:
2.0

doCreateFileSystem

protected abstract FileSystem doCreateFileSystem(FileName rootName,
                                                 FileSystemOptions fileSystemOptions)
                                          throws FileSystemException
Creates a FileSystem. If the returned FileSystem implements VfsComponent, it will be initialised.

Parameters:
rootName - 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.