gate.util
Class JarFiles

java.lang.Object
  |
  +--gate.util.JarFiles

public class JarFiles
extends Object

This class is used to merge a set of Jar/Zip Files in a Jar File It is ignored the manifest.


Field Summary
private static int BUFF_SIZE
           
private  byte[] buffer
           
(package private)  String buggyJar
           
private  StringBuffer dbgString
           
private static boolean DEBUG
          Debug flag
private  Set directorySet
           
private  boolean warning
           
 
Constructor Summary
JarFiles()
           
 
Method Summary
private  void addJar(JarOutputStream destinationJar, JarFile sourceJar)
          This method adds all entries from sourceJar to destinationJar NOTE: that manifest information is not added, method will throw a gate Exception if a duplicate entry file is found.
static void main(String[] args)
          args[0] is the final jar file and the other are the set of jar file names e.g.
 void merge(Set jarFileNames, String destinationJarName)
          This method takes the content of all jar/zip files from the set jarFileNames and put them in a file with the name outputFileName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
Debug flag

See Also:
Constant Field Values

dbgString

private StringBuffer dbgString

warning

private boolean warning

buggyJar

String buggyJar

BUFF_SIZE

private static final int BUFF_SIZE
See Also:
Constant Field Values

directorySet

private Set directorySet

buffer

private byte[] buffer
Constructor Detail

JarFiles

public JarFiles()
Method Detail

merge

public void merge(Set jarFileNames,
                  String destinationJarName)
           throws GateException
This method takes the content of all jar/zip files from the set jarFileNames and put them in a file with the name outputFileName. If the jar entry is manifest then this information isn't added.

Parameters:
jarFileNames - is a set of names of files (jar/zip)
GateException

addJar

private void addJar(JarOutputStream destinationJar,
                    JarFile sourceJar)
             throws GateException
This method adds all entries from sourceJar to destinationJar NOTE: that manifest information is not added, method will throw a gate Exception if a duplicate entry file is found.

Parameters:
destinationJar - the jar that will collect all the entries from source jar
sourceJar - doesn't need any explanation ... DOES it?
GateException

main

public static void main(String[] args)
args[0] is the final jar file and the other are the set of jar file names e.g. java gate.util.JarFiles libs.jar ../lib/*.jar ../lib/*.zip will create a file calls libs.jar which will contain all jar files and zip files