org.objectweb.jonas_ws.wsgen.utils
Class FileUtils

java.lang.Object
  extended byorg.objectweb.jonas_ws.wsgen.utils.FileUtils

public class FileUtils
extends java.lang.Object

FileUtils is an utility class with no instance. Used to pack a directory into a jar archive, copy a file, move a file, ...

Author:
Guillaume Sauthier

Field Summary
static int MAX_BUFFER_SIZE
          Buffer Size
 
Method Summary
static void copy(java.io.File source, java.io.File target)
          Copy a source file into a destination directory.
static java.io.File unpack(java.util.jar.JarFile source)
          Unpack the source archive in a temporary directory and returns temporary directory created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_BUFFER_SIZE

public static final int MAX_BUFFER_SIZE
Buffer Size

See Also:
Constant Field Values
Method Detail

unpack

public static java.io.File unpack(java.util.jar.JarFile source)
                           throws java.io.IOException
Unpack the source archive in a temporary directory and returns temporary directory created.

Parameters:
source - source JarFile to be unpacked
Returns:
root directory containing unpacked archive.
Throws:
java.io.IOException - When unpack fails

copy

public static void copy(java.io.File source,
                        java.io.File target)
                 throws java.io.IOException
Copy a source file into a destination directory.

Parameters:
source - source file
target - destination directory
Throws:
java.io.IOException - When copy cannot succeed