jxl.util
Class FileUtils

java.lang.Object
  extended by jxl.util.FileUtils

public final class FileUtils
extends java.lang.Object

Author:
epr

Method Summary
static void copy(java.io.File source, java.io.File target)
          Manually copy bytes from source to target
static void copy(java.io.InputStream is, byte[] dest)
          Copy dest.length bytes from the inputstream into the dest bytearray.
static void copy(java.io.InputStream is, java.io.OutputStream os, byte[] buf, boolean close)
          Copy the contents of is to os.
static boolean copy(java.util.Set<java.io.File> sources, java.io.File toDir, boolean printout)
           
static boolean deleteRecursively(java.io.File dir)
           
static byte[] digest(java.io.File f)
           
static void flush(byte[] data, java.io.File toFile)
           
static java.util.Set<java.io.File> getRecursiveFiles(java.io.File dir)
          Get all of the files (not dirs) under dir
static byte[] load(java.io.File f)
          Read f and return as byte[]
static byte[] load(java.io.InputStream is, boolean close)
          Copy the contents of is to the returned byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

digest

public static byte[] digest(java.io.File f)
                     throws java.io.IOException,
                            java.security.NoSuchAlgorithmException
Throws:
java.io.IOException
java.security.NoSuchAlgorithmException

getRecursiveFiles

public static java.util.Set<java.io.File> getRecursiveFiles(java.io.File dir)
                                                     throws java.io.IOException
Get all of the files (not dirs) under dir

Parameters:
dir - Directory to search.
Returns:
all the files under dir
Throws:
java.io.IOException

deleteRecursively

public static boolean deleteRecursively(java.io.File dir)

copy

public static void copy(java.io.InputStream is,
                        byte[] dest)
                 throws java.io.IOException
Copy dest.length bytes from the inputstream into the dest bytearray.

Parameters:
is -
dest -
Throws:
java.io.IOException

copy

public static void copy(java.io.File source,
                        java.io.File target)
                 throws java.io.IOException
Manually copy bytes from source to target

Parameters:
source -
target -
Throws:
java.io.IOException

copy

public static boolean copy(java.util.Set<java.io.File> sources,
                           java.io.File toDir,
                           boolean printout)
                    throws java.io.IOException
Throws:
java.io.IOException

copy

public static final void copy(java.io.InputStream is,
                              java.io.OutputStream os,
                              byte[] buf,
                              boolean close)
                       throws java.io.IOException
Copy the contents of is to os.

Parameters:
is -
os -
buf - Can be null
close - If true, is is closed after the copy.
Throws:
java.io.IOException

flush

public static void flush(byte[] data,
                         java.io.File toFile)
                  throws java.io.IOException
Throws:
java.io.IOException

load

public static final byte[] load(java.io.File f)
                         throws java.io.IOException
Read f and return as byte[]

Parameters:
f -
Returns:
bytes from f
Throws:
java.io.IOException

load

public static final byte[] load(java.io.InputStream is,
                                boolean close)
                         throws java.io.IOException
Copy the contents of is to the returned byte array.

Parameters:
is -
close - If true, is is closed after the copy.
Throws:
java.io.IOException