Package nl.siegmann.epublib.util
Class VFSUtil
- java.lang.Object
-
- nl.siegmann.epublib.util.VFSUtil
-
public class VFSUtil extends java.lang.ObjectUtitilies for making working with apache commons VFS easier.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description VFSUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringcalculateHref(org.apache.commons.vfs2.FileObject rootDir, org.apache.commons.vfs2.FileObject currentFile)static ResourcecreateResource(org.apache.commons.vfs2.FileObject rootDir, org.apache.commons.vfs2.FileObject file, java.lang.String inputEncoding)static org.apache.commons.vfs2.FileObjectresolveFileObject(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 Filestatic java.io.InputStreamresolveInputStream(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
-
-
-
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.FileSystemExceptionFirst 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.FileSystemExceptionFirst 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
-
-