org.objectweb.telosys.util
Class JarUtil

java.lang.Object
  extended byorg.objectweb.telosys.util.JarUtil

public class JarUtil
extends java.lang.Object

Utility class for JAR FILE operations ( set of static methods )


Field Summary
static boolean KEEP_PARENT_DIR
           
static boolean REMOVE_PARENT_DIR
           
 
Method Summary
static void extract(java.lang.String sJarFile, java.lang.String sJarEntry, java.lang.String sExtractedFile)
          Extracts a file from a JAR file (replace the extracted file if it exists)
static void extractEntry(java.util.jar.JarFile jarFile, java.util.jar.JarEntry jarEntry, java.lang.String sExtractedFile)
          Extract the given entry from the given JAR file The destination directories are created if necessary.
static void extractFiles(java.lang.String sJarFile, java.lang.String sBeginning, java.lang.String sArgDestDir, boolean bKeepParentDir)
          Extract all the files corresponding to the given beginning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEEP_PARENT_DIR

public static final boolean KEEP_PARENT_DIR
See Also:
Constant Field Values

REMOVE_PARENT_DIR

public static final boolean REMOVE_PARENT_DIR
See Also:
Constant Field Values
Method Detail

extract

public static void extract(java.lang.String sJarFile,
                           java.lang.String sJarEntry,
                           java.lang.String sExtractedFile)
                    throws TelosysException
Extracts a file from a JAR file (replace the extracted file if it exists)

Parameters:
sJarFile - jar file name
sJarEntry - file name to extract
sExtractedFile - file name of the extracted file
Throws:
TelosysException

extractEntry

public static void extractEntry(java.util.jar.JarFile jarFile,
                                java.util.jar.JarEntry jarEntry,
                                java.lang.String sExtractedFile)
                         throws TelosysException
Extract the given entry from the given JAR file The destination directories are created if necessary.

Parameters:
jarFile -
jarEntry -
sExtractedFile -
Throws:
TelosysException

extractFiles

public static void extractFiles(java.lang.String sJarFile,
                                java.lang.String sBeginning,
                                java.lang.String sArgDestDir,
                                boolean bKeepParentDir)
                         throws TelosysException
Extract all the files corresponding to the given beginning

Parameters:
sJarFile - the JAR file name
sBeginning - the beginning of the file names to extract
sArgDestDir - the destination directory
bKeepParentDir - KEEP_PARENT_DIR (true) : to keep the parent directory of the JAR entry,
REMOVE_PARENT_DIR (false) : to remove the parent directory
Throws:
TelosysException