Package org.apache.commons.vfs2
Class FileUtil
java.lang.Object
org.apache.commons.vfs2.FileUtil
Utility methods for dealing with FileObjects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
copyContent
(FileObject srcFile, FileObject destFile) Copies the content from a source file to a destination file.static byte[]
getContent
(FileObject file) Returns the content of a file, as a byte array.static void
writeContent
(FileObject file, OutputStream output) Writes the content of a file to an OutputStream.
-
Method Details
-
getContent
Returns the content of a file, as a byte array.- Parameters:
file
- The file to get the content of.- Returns:
- The content as a byte array.
- Throws:
IOException
- if the file content cannot be accessed.
-
writeContent
Writes the content of a file to an OutputStream.- Parameters:
file
- The FileObject to write.output
- The OutputStream to write to.- Throws:
IOException
- if an error occurs writing the file.- See Also:
-
copyContent
Copies the content from a source file to a destination file.- Parameters:
srcFile
- The source FileObject.destFile
- The target FileObject- Throws:
IOException
- If an error occurs copying the file.- See Also:
-