Class VFSFileSystem


public class VFSFileSystem extends DefaultFileSystem
FileSystem that uses Apache Commons VFS.
Since:
1.7
  • Field Details

    • log

      private final org.apache.commons.logging.Log log
      The logger.
  • Constructor Details

    • VFSFileSystem

      public VFSFileSystem()
  • Method Details

    • getBasePath

      public String getBasePath(String path)
      Description copied from class: FileSystem
      Gets the base path of the given path, for example a directory for a file.
      Overrides:
      getBasePath in class DefaultFileSystem
      Parameters:
      path - the source path.
      Returns:
      the base path.
    • getFileName

      public String getFileName(String path)
      Description copied from class: FileSystem
      Gets the file name of the given path.
      Overrides:
      getFileName in class DefaultFileSystem
      Parameters:
      path - the source path.
      Returns:
      the file name.
    • getInputStream

      public InputStream getInputStream(URL url) throws ConfigurationException
      Description copied from class: FileSystem
      Gets an input stream for a URL.
      Overrides:
      getInputStream in class DefaultFileSystem
      Parameters:
      url - the source URL.
      Returns:
      an input stream.
      Throws:
      ConfigurationException - if an problem occurs getting the input stream.
    • getManager

      private org.apache.commons.vfs2.FileSystemManager getManager() throws org.apache.commons.vfs2.FileSystemException
      Throws:
      org.apache.commons.vfs2.FileSystemException
    • getOptions

      private org.apache.commons.vfs2.FileSystemOptions getOptions(String scheme)
    • getOutputStream

      public OutputStream getOutputStream(URL url) throws ConfigurationException
      Description copied from class: FileSystem
      Gets an output stream for a URL.
      Overrides:
      getOutputStream in class DefaultFileSystem
      Parameters:
      url - the source URL.
      Returns:
      an output stream.
      Throws:
      ConfigurationException - if an problem occurs getting the output stream.
    • getPath

      public String getPath(File file, URL url, String basePath, String fileName)
      Description copied from class: FileSystem
      Gets a path string for the given input where some values may be null.

      The implementation decides on which argument take precedence.

      Overrides:
      getPath in class DefaultFileSystem
      Parameters:
      file - A file.
      url - A URL.
      basePath - A base path string.
      fileName - A file name.
      Returns:
      A path string.
    • getURL

      public URL getURL(String basePath, String file) throws MalformedURLException
      Description copied from class: FileSystem
      Gets a URL for a base path and file name.
      Overrides:
      getURL in class DefaultFileSystem
      Parameters:
      basePath - The base path.
      file - The file name.
      Returns:
      a URL.
      Throws:
      MalformedURLException - if a problem occurs creating the URL.
    • locateFromURL

      public URL locateFromURL(String basePath, String fileName)
      Description copied from class: FileSystem
      Locates a URL for a base path and file name.
      Overrides:
      locateFromURL in class DefaultFileSystem
      Parameters:
      basePath - The base path.
      fileName - The file name.
      Returns:
      a URL.
    • resolveURI

      private org.apache.commons.vfs2.FileName resolveURI(String path) throws org.apache.commons.vfs2.FileSystemException
      Throws:
      org.apache.commons.vfs2.FileSystemException
    • setProperty

      private void setProperty(org.apache.commons.vfs2.FileSystemConfigBuilder builder, org.apache.commons.vfs2.FileSystemOptions options, String key, Object value)