com.springsource.util.io
Class JarUtils

java.lang.Object
  extended by com.springsource.util.io.JarUtils

public final class JarUtils
extends java.lang.Object

Utility code for working with JAR files.

Concurrent Semantics
Threadsafe


Constructor Summary
JarUtils()
           
 
Method Summary
static void unpackTo(PathReference jarFile, PathReference dest)
          Unpacks the JAR file at jarFile to the directory dest.

If the supplied dest PathReference does not exist, it is created as a directory and the JAR file is unpacked directly into the newly created directory.

If the supplied dest PathReference already exists and is a directory then the JAR file is unpacked as a subdirectory of the supplied directory this directory.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarUtils

public JarUtils()
Method Detail

unpackTo

public static void unpackTo(PathReference jarFile,
                            PathReference dest)
                     throws java.io.IOException
Unpacks the JAR file at jarFile to the directory dest.

If the supplied dest PathReference does not exist, it is created as a directory and the JAR file is unpacked directly into the newly created directory.

If the supplied dest PathReference already exists and is a directory then the JAR file is unpacked as a subdirectory of the supplied directory this directory. The name of the generated subdirectory is that of the JAR file without the file extension - so foo.jar is unpacked into a directory foo.

Parameters:
jarFile - the JAR file to unpack
dest - the destination directory
Throws:
java.io.IOException - if an error occurs during unpack.