Class VFSUtil


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

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

      Constructors 
      Constructor Description
      VFSUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.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, java.lang.String inputEncoding)  
      static org.apache.commons.vfs2.FileObject resolveFileObject​(java.lang.String inputLocation)
      First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local File
      static java.io.InputStream resolveInputStream​(java.lang.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 Detail

      • log

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

      • VFSUtil

        public VFSUtil()
    • Method Detail

      • createResource

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

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

        public static org.apache.commons.vfs2.FileObject resolveFileObject​(java.lang.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 java.io.InputStream resolveInputStream​(java.lang.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