All Packages Class Hierarchy This Package Previous Next Index
Class utilities.AS400ToolboxJarMaker
java.lang.Object
|
+----utilities.JarMaker
|
+----utilities.AS400ToolboxJarMaker
- public class AS400ToolboxJarMaker
- extends JarMaker
The AS400ToolboxJarMaker class is used to generate a smaller
JAR or ZIP file from the shipped AS/400 Toolbox for Java
JAR or ZIP file, based on the user's requirements.
In addition, AS400ToolboxJarMaker can also be used to:
- extract desired files from a JAR or ZIP file; or
- split a JAR or ZIP file into smaller JAR or ZIP files.
An AS400ToolboxJarMaker object can be included in the user's program,
or AS400ToolboxJarMaker can be run as a command line program, as follows:
java utilities.AS400ToolboxJarMaker [ options ]
AS400ToolboxJarMaker extends the functionality of JarMaker by
additionally allowing the user to specify one or more
AS/400 Toolbox for Java components,
languages, and CCSIDs, and whether or not to include any
Java Beans files that are associated with the specified components.
Options
-source
sourceJarFile
-
Specifies the source JAR or ZIP file from which to derive
the destination JAR or ZIP file.
If a relative path is specified, the path is assumed to be relative to
the current directory.
If this option is specified as the first positional argument,
the tag (
-source
) is optional.
The option tag may be abbreviated -s
.
The default is jt400.jar
, in the current directory.
-destination
destinationJarFile
-
Specifies the destination JAR or ZIP file, which will contain
the desired subset of the files in the source JAR or ZIP file.
If a pathname is not specified, the file is created in the current directory.
The option tag may be abbreviated
-d
.
The default name is generated by appending "Small"
to the
source file name. For example, if the source file is myfile.jar
,
then the default destination file would be myfileSmall.jar
.
-requiredFile
jarEntry1[,jarEntry2[...] ]
-
The files in the source JAR or ZIP file that are to be copied to the destination.
Entries are separated by commas (no spaces).
The specified files, along with all of their dependencies,
will be considered required.
Files are specified in JAR entry name syntax, such as
com/ibm/as400/access/DataQueue.class
.
The option tag may be abbreviated -rf
.
-additionalFile
file1[,file2[...] ]
-
Specifies additional files (not included in the source jar) which are
to be copied to the destination.
Entries are separated by commas (no spaces).
Files are specified by either their
absolute path, or their path relative to the current directory.
The specified files will be included, regardless of the settings of
other options.
The option tag may be abbreviated -af
.
-additionalFilesDirectory
baseDirectory
-
Specifies the base directory for additional files.
This should be the parent directory of the
directory where the package path starts. For example, if file
foo.class
in package com.ibm.mypackage
is located in directory
C:\dir1\subdir2\com\ibm\mypackage\
, then specify base directory C:\dir1\subdir2
.
The option tag may be abbreviated -afd
.
The default is the current directory.
-package
package1[,package2[...] ]
-
The packages that are required.
Entries are separated by commas (no spaces).
The option tag may be abbreviated
-p
.
Package names are specified in standard syntax, such as com.ibm.component
.
Note: The specified packages are simply included in the output.
No additional dependency analysis is done on the files in a package,
unless they are explicitly specified as required files.
-extract
[baseDirectory]
-
Extracts the desired entries of the source JAR into the specified base directory,
without generating a new JAR or ZIP file. This option enables the
user to build up a customized JAR or ZIP file empirically,
based on the requirements of their particular application.
When this option is specified,
-additionalFile
,
-additionalFilesDirectory
, and -destination
are ignored.
The option tag may be abbreviated -x
.
By default, no extraction is done.
The default base directory is the current directory.
-split
[splitSize]
-
Splits the source JAR or ZIP file into smaller JAR or ZIP files.
No ZIP entries are added or excluded;
the entries in the source JAR or ZIP file are simply distributed
among the destination JAR or ZIP files.
The split size is in units of kilobytes (1024 bytes),
and specifies the maximum size for the destination files.
The destination files are created in the current directory,
and are named by appending integers to the source file name;
any existing files by the same name are overwritten.
For example, if the source JAR file is
myfile.jar
,
then the destination JAR files would be
myfile0.jar
, myfile1.jar
, and so on.
When this option is specified, all other options except
-source
and -verbose
are ignored.
The option tag may be abbreviated -sp
.
The default split size is 2 megabytes (2048 kilobytes).
-verbose
-
Causes progress messages to be printed to
System.out
.
The option tag may be abbreviated -v
.
The default is non-verbose.
-component
componentID1[,componentID2[...] ]
-
The AS/400 Toolbox for Java components that are required.
Entries are separated by commas (no spaces), and are case insensitive.
The option tag may be abbreviated
-c
.
See the list of components
that are supported by AS/400 Toolbox for Java.
-beans
-
Causes inclusion of all Java Beans files (classes, gifs) that are
directly associated with the specified components.
This option is valid only if
-component
is also specified.
The option tag may be abbreviated -b
.
The default is no Beans.
-language
language1[,language2[...]]
-
Specifies the desired languages for the messages produced by the Toolbox classes.
Entries are separated by commas (no spaces).
The languages are identified by their Java locale name, such as fr_CA
(for Canadian French).
Note: The shipped jt400.jar file contains only English messages.
The option tag may be abbreviated -l
.
By default, only English messages are included.
-languageDirectory
baseDirectory
-
Specifies the base directory for additional Toolbox language files.
The path below this directory should correspond to the package name
the language files.
For example, if the desired MRI files are located in directories
/usr/myDir/com/ibm/as400/access/
and
/usr/myDir/com/ibm/as400/vaccess/
,
then the base directory should be set to /usr/myDir
.
The option tag may be abbreviated -ld
.
By default, language files are searched for relative to the
current directory.
-ccsid
ccsid1[,ccsid2[...]]
-
Specifies the CCSIDs whose conversion tables should be included.
Conversion tables for other CCSIDs will not be included.
Entries are separated by commas (no spaces).
The option tag may be abbreviated
-cc
.
By default, all CCSIDs are included.
See the list of CCSIDs and encodings
that are supported by AS/400 Toolbox for Java.
-ccsidExcluded
ccsid1[,ccsid2[...]]
-
Specifies the CCSIDs whose conversion tables should not be included.
Entries are separated by commas (no spaces). If a CCSID is specified on
both the
-ccsid
and -ccsidExcluded
, it is included,
and a warning message is sent to System.err
.
The option tag may be abbreviated -cx
.
By default, all shipped CCSIDs are included.
See the list of CCSIDs and encodings
that are supported by AS/400 Toolbox for Java.
At least one of the following options must be specified:
- -requiredFile
- -additionalFile
- -package
- -extract
- -split
- -component
- -language
- -ccsid
- -ccsidExcluded
If the following options are specified multiple times in a single command
string, only the final specification applies:
- -source
- -destination
- -additionalFilesDirectory
- -extract
- -split
- -languageDirectory
Other options have a cumulative effect when specified multiple times
in a single command string.
Example usage
To create a JAR file that contains only those files needed
by the CommandCall
and ProgramCall
components,
do the following:
- Go to the directory where the
jt400.jar
file is located.
- Type:
java utilities.AS400ToolboxJarMaker -component CommandCall,ProgramCall
- Save a copy of the original
jt400.jar
for future reference.
- Rename
jt400Small.jar
to jt400.jar
.
To extract from jt400.jar only those files needed
by class com.ibm.as400.access.JDSQLStatement
,
using the current directory as the base directory for output, do the following:
java utilities.AS400ToolboxJarMaker -extract -s jt400.jar
-rf com/ibm/as400/access/JDSQLStatement.class
Any additional files could then be manually copied into appropriate locations
in the directory tree, and a customized JAR file could be generated using the
jar
tool provided as part of the JDK.
-
AS400
- Constant for specifying the AS400 component.
-
AS400_VISUAL
- Constant for specifying the Visual AS400 component.
-
COMMAND_CALL
- Constant for specifying the Command Call component.
-
COMMAND_CALL_VISUAL
- Constant for specifying the Visual Command Call component.
-
DATA_DESCRIPTION
- Constant for specifying the Data Description component.
-
DATA_QUEUE
- Constant for specifying the Data Queue component.
-
DATA_QUEUE_VISUAL
- Constant for specifying the Visual Data Queue component.
-
DIGITAL_CERTIFICATE
- Constant for specifying the Digital Certificate component.
-
INTEGRATED_FILE_SYSTEM
- Constant for specifying the Integrated File System component.
-
INTEGRATED_FILE_SYSTEM_VISUAL
- Constant for specifying the Visual Integrated File System component.
-
JDBC
- Constant for specifying the JDBC component.
-
JDBC_VISUAL
- Constant for specifying the Visual JDBC component.
-
JOB
- Constant for specifying the Job component.
-
JOB_VISUAL
- Constant for specifying the Visual Job component.
-
MESSAGE
- Constant for specifying the Message Queue component.
-
MESSAGE_VISUAL
- Constant for specifying the Visual Message Queue component.
-
NUMERIC_DATA_TYPES
- Constant for specifying the Numeric Data Types component.
-
PRINT
- Constant for specifying the Network Print component.
-
PRINT_VISUAL
- Constant for specifying the Visual Network Print component.
-
PROGRAM_CALL
- Constant for specifying the Program Call component.
-
PROGRAM_CALL_VISUAL
- Constant for specifying the Visual Program Call component.
-
RECORD_LEVEL_ACCESS
- Constant for specifying the Record Level Access component.
-
RECORD_LEVEL_ACCESS_VISUAL
- Constant for specifying the Visual Record Level Access component.
-
SECURE_AS400
- Constant for specifying the Secure AS400 component.
-
TRACE
- Constant for specifying the Trace component.
-
USER
- Constant for specifying the User component.
-
USER_SPACE
- Constant for specifying the User Space component.
-
USER_VISUAL
- Constant for specifying the Visual User component.
-
AS400ToolboxJarMaker()
- Constructs an AS400ToolboxJarMaker object.
-
getCCSIDs()
- Returns the CCSIDs explicitly to be included.
-
getCCSIDsExcluded()
- Returns CCSIDs to be excluded.
-
getComponents()
- Returns the required components specified by the user.
-
getLanguageDirectory()
- Returns the base directory under which the Toolbox language files
will be searched for.
-
getLanguages()
- Returns the national languages that explicitly are to be supported.
-
main(String[])
- Performs the actions specified in the invocation arguments.
-
reset()
- Resets the AS400ToolboxJarMaker object to a clean, default state,
to facilitate object reuse.
-
setCCSIDs(Vector)
- Specifies the CCSIDs explicitly to be included.
-
setCCSIDsExcluded(Vector)
- Specifies CCSIDs to be excluded.
-
setComponents(Vector)
- Specifies required AS/400 Toolbox for Java components.
-
setComponents(Vector, boolean)
- Specifies required AS/400 Toolbox for Java components.
-
setLanguageDirectory(File)
- Specifies the base directory for additional Toolbox language files.
-
setLanguages(Vector)
- Specifies national languages that explicitly are to be supported.
AS400
public static final Integer AS400
- Constant for specifying the AS400 component.
COMMAND_CALL
public static final Integer COMMAND_CALL
- Constant for specifying the Command Call component.
DATA_DESCRIPTION
public static final Integer DATA_DESCRIPTION
- Constant for specifying the Data Description component.
DATA_QUEUE
public static final Integer DATA_QUEUE
- Constant for specifying the Data Queue component.
DIGITAL_CERTIFICATE
public static final Integer DIGITAL_CERTIFICATE
- Constant for specifying the Digital Certificate component.
INTEGRATED_FILE_SYSTEM
public static final Integer INTEGRATED_FILE_SYSTEM
- Constant for specifying the Integrated File System component.
JDBC
public static final Integer JDBC
- Constant for specifying the JDBC component.
JOB
public static final Integer JOB
- Constant for specifying the Job component.
MESSAGE
public static final Integer MESSAGE
- Constant for specifying the Message Queue component.
NUMERIC_DATA_TYPES
public static final Integer NUMERIC_DATA_TYPES
- Constant for specifying the Numeric Data Types component.
PRINT
public static final Integer PRINT
- Constant for specifying the Network Print component.
PROGRAM_CALL
public static final Integer PROGRAM_CALL
- Constant for specifying the Program Call component.
RECORD_LEVEL_ACCESS
public static final Integer RECORD_LEVEL_ACCESS
- Constant for specifying the Record Level Access component.
SECURE_AS400
public static final Integer SECURE_AS400
- Constant for specifying the Secure AS400 component.
TRACE
public static final Integer TRACE
- Constant for specifying the Trace component.
USER
public static final Integer USER
- Constant for specifying the User component.
USER_SPACE
public static final Integer USER_SPACE
- Constant for specifying the User Space component.
AS400_VISUAL
public static final Integer AS400_VISUAL
- Constant for specifying the Visual AS400 component.
COMMAND_CALL_VISUAL
public static final Integer COMMAND_CALL_VISUAL
- Constant for specifying the Visual Command Call component.
DATA_QUEUE_VISUAL
public static final Integer DATA_QUEUE_VISUAL
- Constant for specifying the Visual Data Queue component.
INTEGRATED_FILE_SYSTEM_VISUAL
public static final Integer INTEGRATED_FILE_SYSTEM_VISUAL
- Constant for specifying the Visual Integrated File System component.
JDBC_VISUAL
public static final Integer JDBC_VISUAL
- Constant for specifying the Visual JDBC component.
JOB_VISUAL
public static final Integer JOB_VISUAL
- Constant for specifying the Visual Job component.
MESSAGE_VISUAL
public static final Integer MESSAGE_VISUAL
- Constant for specifying the Visual Message Queue component.
PRINT_VISUAL
public static final Integer PRINT_VISUAL
- Constant for specifying the Visual Network Print component.
PROGRAM_CALL_VISUAL
public static final Integer PROGRAM_CALL_VISUAL
- Constant for specifying the Visual Program Call component.
RECORD_LEVEL_ACCESS_VISUAL
public static final Integer RECORD_LEVEL_ACCESS_VISUAL
- Constant for specifying the Visual Record Level Access component.
USER_VISUAL
public static final Integer USER_VISUAL
- Constant for specifying the Visual User component.
AS400ToolboxJarMaker
public AS400ToolboxJarMaker()
- Constructs an AS400ToolboxJarMaker object.
getCCSIDs
public Vector getCCSIDs()
- Returns the CCSIDs explicitly to be included.
- Returns:
- The CCSIDs explicitly to be included.
The list will be empty if none has been specified.
The list will contain only
Integer
objects.
getCCSIDsExcluded
public Vector getCCSIDsExcluded()
- Returns CCSIDs to be excluded.
- Returns:
- The CCSIDs to be excluded.
The list will be empty if none has been specified.
The list will contain only
Integer
objects.
getComponents
public Vector getComponents()
- Returns the required components specified by the user.
- Returns:
- The components specified by the user.
The list will be empty if none has been specified.
The list will contain only
Integer
objects.
See component list for
a list of integer values and associated components.
getLanguageDirectory
public File getLanguageDirectory()
- Returns the base directory under which the Toolbox language files
will be searched for.
This value is set by
setLanguageDirectory()
.
- Returns:
- The base directory for the language files.
getLanguages
public Vector getLanguages()
- Returns the national languages that explicitly are to be supported.
The languages are identified by their Java locale name, such as fr_CA
(for Canadian French).
Note: Locale
en
is always implicitly supported.
- Returns:
- The national languages that explicitly are to be supported.
The list will be empty if none has been specified.
The list will contain only
String
objects.
reset
public void reset()
- Resets the AS400ToolboxJarMaker object to a clean, default state,
to facilitate object reuse.
- Overrides:
- reset in class JarMaker
setCCSIDs
public void setCCSIDs(Vector ccsidList)
- Specifies the CCSIDs explicitly to be included.
The conversion tables for only these CCSIDs (and CCSIDs
specified in any prior invocations) will be included in the output.
Conversion tables for other CCSIDs will not be included.
Note: This augments any previously specified CCSIDs.
This method does not verify the existence of the specified CCSIDs.
- Parameters:
- ccsidList - The CCSIDs explicitly to be included.
The list should contain only
Integer
objects.
See CCSIDs and encodings
for valid values.
setCCSIDsExcluded
public void setCCSIDsExcluded(Vector ccsidList)
- Specifies CCSIDs to be excluded.
The conversion tables for these CCSIDs will not be included in the output.
Note: This augments any previously specified CCSIDs.
This method does not verify the existence of the specified CCSIDs.
- Parameters:
- ccsidList - The CCSIDs to be excluded.
The list should contain only
Integer
objects.
setComponents
public void setComponents(Vector components)
- Specifies required AS/400 Toolbox for Java components.
Java Beans files associated with the components are not
automatically included.
Note: This augments any previously specified components.
If an unrecognized component is specified, a warning message is
sent to System.err
, and the component is ignored.
- Parameters:
- components - The required components.
The list should contain only
Integer
objects.
See component list for valid values.
setComponents
public void setComponents(Vector components,
boolean includeBeans)
- Specifies required AS/400 Toolbox for Java components.
Note: This augments any previously specified components.
If an unrecognized component is specified, a warning message is
sent to System.err
, and the component is ignored.
- Parameters:
- components - The required components.
The list should contain only
Integer
objects.
See component list for valid values.
- includeBeans - Whether or not Java Beans files associated
with the components are to be included.
setLanguageDirectory
public void setLanguageDirectory(File baseDirectory)
- Specifies the base directory for additional Toolbox language files.
The path below this directory should correspond to the package name
the language files.
For example, if the MRI files are located in directories
/usr/myDir/com/ibm/as400/access
and
/usr/myDir/com/ibm/as400/vaccess
,
then the base directory should be set to /usr/myDir
.
This method does not verify the existence of the specified directory.
The default language directory is the current directory.
- Parameters:
- baseDirectory - The base directory for the language files.
setLanguages
public void setLanguages(Vector languages)
- Specifies national languages that explicitly are to be supported.
Languages are identified by their Java locale name, such as
fr_CA
.
The language files for the specified languages will be searched for
in the directory tree specified by setLanguageDirectory
,
or, if no directory has been specified, in the directory tree
under the current directory.
Note: This augments any previously specified languages.
This method does not verify the existence of files for the specified
languages.
Locale en
is always implicitly supported.
If an unrecognized language is specified, a warning message is
sent to System.err
, and the language is ignored.
- Parameters:
- languages - The languages to be supported.
The list should contain only
String
objects.
main
public static void main(String args[])
- Performs the actions specified in the invocation arguments.
- Parameters:
- args - The command line arguments.
All Packages Class Hierarchy This Package Previous Next Index