Class VFSUtil

java.lang.Object
nl.siegmann.epublib.util.VFSUtil

public class VFSUtil extends Object
Utitilies for making working with apache commons VFS easier.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    calculateHref(org.apache.commons.vfs2.FileObject rootDir, org.apache.commons.vfs2.FileObject currentFile)
     
    static Resource
    createResource(org.apache.commons.vfs2.FileObject rootDir, org.apache.commons.vfs2.FileObject file, String inputEncoding)
     
    static org.apache.commons.vfs2.FileObject
    resolveFileObject(String inputLocation)
    First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local File
    resolveInputStream(String inputLocation)
    First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local File

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      private static final org.slf4j.Logger log
  • Constructor Details

    • VFSUtil

      public VFSUtil()
  • Method Details

    • createResource

      public static Resource createResource(org.apache.commons.vfs2.FileObject rootDir, org.apache.commons.vfs2.FileObject file, String inputEncoding) throws IOException
      Throws:
      IOException
    • calculateHref

      public static String calculateHref(org.apache.commons.vfs2.FileObject rootDir, org.apache.commons.vfs2.FileObject currentFile) throws IOException
      Throws:
      IOException
    • resolveFileObject

      public static org.apache.commons.vfs2.FileObject resolveFileObject(String inputLocation) throws org.apache.commons.vfs2.FileSystemException
      First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local File
      Parameters:
      inputLocation -
      Returns:
      the FileObject referred to by the inputLocation
      Throws:
      org.apache.commons.vfs2.FileSystemException
    • resolveInputStream

      public static InputStream resolveInputStream(String inputLocation) throws org.apache.commons.vfs2.FileSystemException
      First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local File
      Parameters:
      inputLocation -
      Returns:
      the InputStream referred to by the inputLocation
      Throws:
      org.apache.commons.vfs2.FileSystemException