Class VFSUtil
java.lang.Object
nl.siegmann.epublib.util.VFSUtil
Utitilies for making working with apache commons VFS easier.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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, String inputEncoding) static org.apache.commons.vfs2.FileObjectresolveFileObject(String inputLocation) First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local Filestatic InputStreamresolveInputStream(String inputLocation) First tries to load the inputLocation via VFS; if that doesn't work it tries to load it as a local File
-
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
-