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.FileObject
createTempFile
(String prefix, String suffix) Create a temporary file byprefix
andsuffix
and returns it as aFileObject
.static org.apache.commons.vfs2.FileObject
createTempFile
(String prefix, String suffix, org.apache.commons.vfs2.FileObject directory) Create a temporary file byprefix
andsuffix
underdirectory
and returns it as aFileObject
.static File
toFile
(org.apache.commons.vfs2.FileObject fileObject) static org.apache.commons.vfs2.FileObject
toFileObject
(File file)
-
Method Details
-
createTempFile
public static org.apache.commons.vfs2.FileObject createTempFile(String prefix, String suffix) throws IOException Create a temporary file byprefix
andsuffix
and returns it as aFileObject
.- Parameters:
prefix
- temporary file prefixsuffix
- temporary file suffix- Returns:
- a temporary file by
prefix
andsuffix
and 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 byprefix
andsuffix
underdirectory
and returns it as aFileObject
.- Parameters:
prefix
- temporary file prefixsuffix
- temporary file suffixdirectory
- base directory- Returns:
- a temporary file by
prefix
andsuffix
and returns it as aFileObject
- Throws:
IOException
- if IOException occurs
-
toFile
- Parameters:
fileObject
-FileObject
instance- Returns:
- Converts
fileObject
to aFile
instance and return it iffileObject
is a local file - Throws:
IOException
- iffileObject
is not a local file or any IOException occurs
-
toFileObject
- Parameters:
file
- a localFile
object- Returns:
- a
FileObject
from the give localFile
object (file
) - Throws:
IOException
- if any IOException occurs
-