org.milyn.io
Class FileUtils

java.lang.Object
  extended by org.milyn.io.FileUtils

public abstract class FileUtils
extends Object

File utilities.

Author:
tom.fennelly@jboss.com

Constructor Summary
FileUtils()
           
 
Method Summary
static void copyFile(String from, String to)
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

copyFile

public static void copyFile(String from,
                            String to)
                     throws IOException
Throws:
IOException

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.


Copyright © 2018. All rights reserved.