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.
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, registerNatives, toString, wait, wait, wait |
DEBUG
private static final boolean DEBUG
- Debug flag
dbgString
private StringBuffer dbgString
warning
private boolean warning
buggyJar
String buggyJar
BUFF_SIZE
private static final int BUFF_SIZE
directorySet
private Set directorySet
buffer
private byte[] buffer
JarFiles
public JarFiles()
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)outputFileName
- is the name of the file which contains all the
classes of jarFilesNames
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 jarsourceJar
- doesn't need any explanation ... DOES it?
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