org.apache.commons.vfs2
public final class FileUtil extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static 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,
java.io.OutputStream outstr)
Writes the content of a file to an OutputStream.
|
public static byte[] getContent(FileObject file) throws java.io.IOException
file
- The file to get the content of.java.io.IOException
- if the file content cannot be accessed.public static void writeContent(FileObject file, java.io.OutputStream outstr) throws java.io.IOException
file
- The FileObject to write.outstr
- The OutputStream to write to.java.io.IOException
- if an error occurs writing the file.public static void copyContent(FileObject srcFile, FileObject destFile) throws java.io.IOException
srcFile
- The source FileObject.destFile
- The target FileObjectjava.io.IOException
- If an error occurs copying the file.Copyright © 2002-2014 The Apache Software Foundation. All Rights Reserved.