Also, the JarMaker class can unzip a JAR file for you to gain access to the individual content files for basic use.
All of the JarMaker functions are performed with the JarMaker class and the AS400ToolboxJarMaker subclass:
According to your needs, you can invoke the JarMaker methods from within your own Java program or as a standalone program (java utilities.JarMaker [options]). For a complete set of options available to run at a command line prompt, see the following:
For example, with the following code, you are extracting AS400.class and all of its dependent classes from jt400.jar:
java utilities.JarMaker -source jt400.jar -extract outputDir -requiredFile com/ibm/as400/access/AS400.class
Suppose you wanted to break up a large JAR file into smaller JAR files, according to your preferences for content and size. JarMaker, accordingly, provides you with the split(jarFile sourceJARFile | int splitSizeKbytes) function.
In the following code, jt400.jar is split into a set of 300K files:
java utilities.AS400ToolboxJarMaker -split 300
In the following command, for example, a JAR file is created containing only those Toolbox classes needed to make the command call and program call functions of the Toolbox work:
java utilities.AS400ToolboxJarMaker -component CommandCall,ProgramCall
Additionally, because it is not necessary to convert text strings between Unicode and the double byte character set (DBCS) conversion tables, you can create a 400K byte smaller JAR file by omitting the conversion tables with the -ccsid paramater:
java utilities.AS400ToolboxJarMaker -component CommandCAll,ProgramCall -ccsid
Notes:
|
Finally, JarMaker's convenience can, also, be found in its ability to reset
itself for its next invocation. That is, you can include the reset()
method after each use to have the system automatically revert to the default
settings upon completion, thus, enabling the reuse of the JarMaker object.