All Packages Class Hierarchy This Package Previous Next Index
Class utilities.AS400ToolboxInstaller
java.lang.Object
|
+----utilities.AS400ToolboxInstaller
- public class AS400ToolboxInstaller
- extends Object
The AS400ToolboxInstaller class is used to
install, update, compare, and uninstall the AS/400 Toolbox for Java
packages. Note that this class writes to the local file system,
so it may fail if used in an applet.
The AS400ToolboxInstaller class can be included in the user's program,
or it can be run as a command line program, as follows:
java utilities.AS400ToolboxInstaller [ options ]
Options
-install
- Indicates that the specified packages are to be installed.
If the -package option is not specified, all packages will be installed.
The source and target options must be specified when using this option.
The -install option may be abbreviated to -i.
-uninstall
- Indicates that the specified packages are to be removed.
The package and target options must be specified when using this option.
The -uninstall option may be abbreviated to -u.
-compare
- Indicates that the source package with be compared with the
target package to determine if
an update is needed. The package, source, and target options must
be specified when using this option.
The -compare option may be abbreviated to -c.
-package
package1[,package2[, ...]]
- Specifies the package to install, compare, or uninstall.
If -package is specified, at
least one package name must be specified.
The -package option may be abbreviated to -p.
-source
sourceURL
- Specifies the location of the source files. The HTTP server is used
to access the files. The system name or the fully-qualified URL
may be specified. If the system name is specified, it will automatically
be converted to the URL where the licensed program installed the files.
For example, if mySystem is specified, http://mySystem/QIBM/ProdData/HTTP/Public/jt400/
will be used.
The -source option may be abbreviated to -s.
-target
targetDirectory
- Specifies the fully-qualified path name of where to store the files.
The -target option may be abbreviated to -t.
-prompt
- Specifies that the user will be prompted before updating the packages on
the workstation. If not specified, the packages will be updated.
The -prompt option may be abbreviated to -pr.
-?
- Displays the help text.
-help
- Displays the help text.
The -help parameter may be abbreviated to -h.
Install Example
java AS400ToolboxInstaller -install
-source http://myAS400/QIBM/ProdData/HTTP/Public/jt400/
-target c:\java\
The following examples will install the access package.
java AS400ToolboxInstaller -install -package ACCESS
-source http://myAS400/QIBM/ProdData/HTTP/Public/jt400/
-target c:\java\
java AS400ToolboxInstaller -install -package ACCESS
-source mySystem
-target c:\java\
java AS400ToolboxInstaller -i -p ACCESS
-s mySystem
-t c:\java\
Uninstall Example
This example will remove the access package.
java AS400ToolboxInstaller -uninstall -package ACCESS -target c:\java\
Compare Example
This example will compare the current level of the OPNAV package.
java AS400ToolboxInstaller -compare
-package OPNAV
-source http://myAS400/QIBM/ProdData/HTTP/Public/jt400/
-target c:\java\
Help Example
The following will display help information:
java AS400ToolboxInstaller -?
java AS400ToolboxInstaller -help
java AS400ToolboxInstaller -h
-
getClasspathAdditions()
- Returns the set of paths that should be added to the CLASSPATH as a
result of the latest install or uninstall operation.
-
getClasspathRemovals()
- Returns the set of paths that should be removed from the CLASSPATH as a
result of the latest install or uninstall operation.
-
getUnexpandedFiles()
- Returns the set of files that should be expanded as a
result of the latest install or uninstall operation.
-
install(String, String, URL)
- Installs/updates an AS/400 Java Toolbox package.
-
isInstalled(String, String)
- Indicates if the package is installed.
-
isUpdateNeeded(String, String, URL)
- Returns whether the package is downlevel.
-
main(String[])
- Performs the actions specified in the invocation arguments.
-
unInstall(String, String)
- Removes a package from the target.
getClasspathAdditions
public static Vector getClasspathAdditions()
- Returns the set of paths that should be added to the CLASSPATH as a
result of the latest install or uninstall operation. The returned
vector will always be empty after an uninstall.
- Returns:
- The vector of Strings which contain the paths that should be
added to the CLASSPATH
as a result of the latest install or uninstall operation.
getClasspathRemovals
public static Vector getClasspathRemovals()
- Returns the set of paths that should be removed from the CLASSPATH as a
result of the latest install or uninstall operation.
Note:
Removing directories from the classpath may cause Java programs
to fail if the directory contains code required by the Java program.
Extraneous directories in the CLASSPATH
do no harm. Therefore, you may not wish to remove any CLASSPATH
entries, or remove only directories which do not contain any Java
code.
- Returns:
- The vector of Strings which contain the paths that should be
removed from the CLASSPATH
as a result of the latest install or uninstall operation.
getUnexpandedFiles
public static Vector getUnexpandedFiles()
- Returns the set of files that should be expanded as a
result of the latest install or uninstall operation.
Note that not all *.zip files will be in this list. Only those files
designated to be expanded by the package will be included. The returned
vector will always be empty after an uninstall.
- Returns:
- The vector of Strings which contain the files that should be
expanded as a result of the latest install or uninstall operation.
install
public static boolean install(String packageName,
String targetPath,
URL source) throws IOException
- Installs/updates an AS/400 Java Toolbox package.
If the package is already installed,
it will be updated if needed. This method just copies files, it will
not modify the CLASSPATH, or expand any 'zipped' files.
URL sourceURL = new URL("http://myAS400/QIBM/ProdData/HTTP/Public/jt400/");
AS400ToolboxInstaller.install("ACCESS", "C:\\java\\", sourceURL);
- Parameters:
- packageName - The package which to install.
"*ALL" can be used to install all the AS/400
Java Toolbox packages.
- targetPath - The path in which to install. The directory will be
created if it does not exist.
- source - The URL which contains the location which contains the
current package. File names will be appended
to this location, so a trailing path separator
is required.
- Returns:
- true if an install/update occurred, false if no updates were
needed.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
isInstalled
public static boolean isInstalled(String packageName,
String targetPath)
- Indicates if the package is installed. Installation is determined
by examining the target directory for the *.LVL file. This method
does not check for a partial installation, if installation is
incomplete, this method may return true or false.
AS400ToolboxInstaller.isInstalled("ACCESS", "C:\\java\\");
- Parameters:
- packageName - The package which will be checked.
Note that *ALL is not supported.
- targetPath - The path in which the package is installed.
- Returns:
- true if the package has been installed, false if the
package has not been installed.
isUpdateNeeded
public static boolean isUpdateNeeded(String packageName,
String targetPath,
URL source) throws IOException
- Returns whether the package is downlevel. This method will return
true if the package is not installed.
URL sourceURL = new URL("http://myAS400/QIBM/ProdData/HTTP/Public/jt400/");
AS400ToolboxInstaller.isUpdateNeeded("ACCESS", "C:\\java\\", sourceURL);
- Parameters:
- packageName - The package which will be checked.
"*ALL" can be used to check all the AS/400
Java Toolbox packages.
- targetPath - The path in which the package is installed.
- source - The URL which contains the location which contains the
current package. File names will be appended
to this location, so a trailing path separator
is required.
- Returns:
- true if an update is needed, false if no updates are
needed.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
main
public static void main(String args[])
- Performs the actions specified in the invocation arguments. See
the class description for information on the command line parameters.
- Parameters:
- args - The command line arguments.
unInstall
public static Vector unInstall(String packageName,
String targetPath) throws IOException
- Removes a package from the target. This method deletes all the files
in the package, and deletes directories if they are empty.
It does not modify the CLASSPATH.
AS400ToolboxInstaller.unInstall("ACCESS", "C:\\java\\");
- Parameters:
- packageName - The package to remove.
"*ALL" can be used to remove all the AS/400
Java Toolbox packages.
- targetPath - The path from which to remove the package.
- Returns:
- The vector of Strings which contain the names (including path) of
files and directories which exist but could not be deleted.
- Throws: IOException
- If the package is not installed.
All Packages Class Hierarchy This Package Previous Next Index