Class ContentFileObjectUtils
java.lang.Object
org.onehippo.forge.content.exim.core.util.ContentFileObjectUtils
ContentFileObjectUtils providing utilities for
FileObject and File.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.commons.vfs2.FileObjectcreateTempFile(String prefix, String suffix) Create a temporary file byprefixandsuffixand returns it as aFileObject.static org.apache.commons.vfs2.FileObjectcreateTempFile(String prefix, String suffix, org.apache.commons.vfs2.FileObject directory) Create a temporary file byprefixandsuffixunderdirectoryand returns it as aFileObject.static FiletoFile(org.apache.commons.vfs2.FileObject fileObject) static org.apache.commons.vfs2.FileObjecttoFileObject(File file)
-
Method Details
-
createTempFile
public static org.apache.commons.vfs2.FileObject createTempFile(String prefix, String suffix) throws IOException Create a temporary file byprefixandsuffixand returns it as aFileObject.- Parameters:
prefix- temporary file prefixsuffix- temporary file suffix- Returns:
- a temporary file by
prefixandsuffixand returns it as aFileObject - Throws:
IOException- if IOException occurs
-
createTempFile
public static org.apache.commons.vfs2.FileObject createTempFile(String prefix, String suffix, org.apache.commons.vfs2.FileObject directory) throws IOException Create a temporary file byprefixandsuffixunderdirectoryand returns it as aFileObject.- Parameters:
prefix- temporary file prefixsuffix- temporary file suffixdirectory- base directory- Returns:
- a temporary file by
prefixandsuffixand returns it as aFileObject - Throws:
IOException- if IOException occurs
-
toFile
- Parameters:
fileObject-FileObjectinstance- Returns:
- Converts
fileObjectto aFileinstance and return it iffileObjectis a local file - Throws:
IOException- iffileObjectis not a local file or any IOException occurs
-
toFileObject
- Parameters:
file- a localFileobject- Returns:
- a
FileObjectfrom the give localFileobject (file) - Throws:
IOException- if any IOException occurs
-