Package org.smooks.support
Class FileUtils
- java.lang.Object
-
- org.smooks.support.FileUtils
-
public final class FileUtils extends Object
File utilities.- Author:
- tom.fennelly@jboss.com
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
deleteDir(File dir)
Delete directory structure.static byte[]
readFile(File file)
Read the contents of the specified file.static void
writeFile(byte[] bytes, File file)
-
-
-
Method Detail
-
readFile
public static byte[] readFile(File file) throws IOException
Read the contents of the specified file.- Parameters:
file
- The file to read.- Returns:
- The file contents.
- Throws:
IOException
- Error readiong file.
-
writeFile
public static void writeFile(byte[] bytes, File file) throws IOException
- Throws:
IOException
-
deleteDir
public static boolean deleteDir(File dir)
Delete directory structure. Performs a recursive delete.- Parameters:
dir
- The directory to be deleted.- Returns:
- true of the directory is deleted, otherwise false.
-
-