it.imolinfo.jbi4ejb.webservice.generator
Class JarUtil

java.lang.Object
  extended by it.imolinfo.jbi4ejb.webservice.generator.JarUtil

public final class JarUtil
extends java.lang.Object

Helper method to unjar files. Some method are taken from: Taken from:http://www.koders.com/java/fidB15D2DD90588A86609A0E986A7987FA5DF5C454A.aspx TODO :Verify license

Author:
Marco Piraccini

Method Summary
static void unjar(java.io.File jarFile, java.io.File targetDir)
          Extracts the given jar-file to the specified directory.
static void unjar(java.io.File jarFile, java.lang.String resource, java.io.File targetDir)
          Extracts the given resource from a jar-file to the specified directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unjar

public static void unjar(java.io.File jarFile,
                         java.io.File targetDir)
                  throws java.io.IOException
Extracts the given jar-file to the specified directory. The target directory will be cleaned before the jar-file will be extracted.

Parameters:
jarFile - The jar file which should be unpacked
targetDir - The directory to which the jar-content should be extracted.
Throws:
java.io.IOException - when a file could not be written or the jar-file could not read.

unjar

public static void unjar(java.io.File jarFile,
                         java.lang.String resource,
                         java.io.File targetDir)
                  throws java.io.IOException
Extracts the given resource from a jar-file to the specified directory.

Parameters:
jarFile - The jar file which should be unpacked
resource - The name of a resource in the jar
targetDir - The directory to which the jar-content should be extracted.
Throws:
java.io.IOException - when a file could not be written or the jar-file could not read.


Copyright © 2007-2008 Imola Informatica. All Rights Reserved.