Class ContentFileObjectUtils
- java.lang.Object
-
- org.onehippo.forge.content.exim.core.util.ContentFileObjectUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
public static File toFile(org.apache.commons.vfs2.FileObject fileObject) throws IOException
- 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
public static org.apache.commons.vfs2.FileObject toFileObject(File file) throws IOException
- Parameters:
file
- a localFile
object- Returns:
- a
FileObject
from the give localFile
object (file
) - Throws:
IOException
- if any IOException occurs
-
-