com.ibm.jsdt.support.deploymenthelper
Class DeploymentHelper

java.lang.Object
  extended by com.ibm.jsdt.common.Base
      extended by com.ibm.jsdt.support.deploymenthelper.DeploymentHelper
Direct Known Subclasses:
AixDeploymentHelper, HPUXDeploymentHelper, LinuxDeploymentHelper, OS400DeploymentHelper, SolarisDeploymentHelper, WindowsDeploymentHelper

public class DeploymentHelper
extends com.ibm.jsdt.common.Base

Utility class for pre-deployment checker, entry, exit, and main programs. The DeploymentHelper provides operating system independent utilities commonly used in user programs developed for an application wrapper.


Field Summary
static java.lang.String copyright
           
static java.lang.String DEPLOYER_SPECIFICATION_VERSION_KEY
           
protected static int ENTRY_STAGE
           
protected static int EXIT_STAGE
           
static int FAILURE
           
static java.lang.String ISMP_GLOBAL_PROPERTY
           
static java.lang.String ISMP_PRODUCT_PROPERTY
           
static java.lang.String ISMP_WIZARD_PROPERTY
           
protected static int MAIN_STAGE
           
static int PDC_CANCEL_INSTALL
           
static int PDC_DO_NOT_INSTALL
           
static int PDC_DOES_NOT_EXIST
           
static int PDC_EXISTS
           
static java.lang.String resourceBundle
           
static java.lang.String SELECTED_TASK_NAMES_KEY
           
static java.lang.String sNEWLN
          System independent line separator.
static int SUCCESS
           
protected static int VERSIONCHECKER_STAGE
           
static int VPD_INSTALL_LOCATION_PIPE
           
static int VPD_VERSION_PIPE
           
 
Fields inherited from class com.ibm.jsdt.common.Base
NEW_LINE, OS_NAME, SLASH
 
Constructor Summary
DeploymentHelper()
           
 
Method Summary
static boolean arraySearch(java.lang.String[] messageArray, java.lang.String searchString)
          Search for a string in the array.
static long checkFreeSpaceAvailable(java.lang.String path)
          Gets the amount of free disk space in a path.
static long checkTargetDirectory(java.lang.String path)
          Determines the validity of a destination directory stored in the ibmnsi.properties file.
static int compareVersions(java.lang.String version, java.lang.String compareVersion)
          Compares two dotted version strings.
static OperationStatus copyAndRenameFile(java.lang.String source, java.lang.String target, java.lang.String newName)
          Copies a file to another location and renames the file in the new target location.
static OperationStatus copyDirectory(java.lang.String source, java.lang.String target)
          Copies a directory tree from the source to the target.
static OperationStatus copyFile(java.lang.String source, java.lang.String target)
          This method copies a file to another location.
static OperationStatus deleteFile(java.lang.String pathname)
          Deletes a file.
static java.lang.String determineLogFileName()
          Determines the name of the log file
static java.lang.String[] directorySearch(java.lang.String directoryName, java.lang.String dotFileExtensionRegExpression)
          Searches all of the files that end with the specified file extension under the directory specified.
static OperationStatus endOfFileScan(java.lang.String filePathName, java.lang.String searchString, int numOfCharsToSearch)
          Scans a file for a string, starting from the end.
static ProgramOutput executeCommand(java.lang.String cmdLaunchDir, java.lang.String[] commandEnvironmentArray, boolean isLocalInteractive, boolean waitForOutput, java.lang.String commandToLog, java.lang.String command)
          Executes the specified command in a separate process through Runtime.exec() with the specified environment and working directory and waits for it to finish.
static boolean fileExists(java.lang.String pathname)
          Checks for existence of a file.
static boolean fileGrep(java.lang.String filePath, java.lang.String searchString, int startIndex)
          Scans a file for a string.
static long fileLength(java.lang.String fileName)
          Returns the length of the file in bytes
static OperationStatus fileScan(java.lang.String filePathName, java.lang.String searchString, int startIndex)
          Scans a file for a string.
static int fileSearchAndReplace(java.lang.String filePathName, java.lang.String findString, java.lang.String replaceString, boolean ignoreCase, boolean createBackup)
          Performs a find and replace in a given file.
static int fileSearchAndReplaceLine(java.lang.String filePathName, java.lang.String findLine, java.lang.String replaceLine, boolean ignoreCase, boolean ignoreWhitespace, boolean createBackup)
          Performs a find and replace of a line in the specified file.
static java.lang.String[] fileSearchAndReturnLinesWithSearch(java.lang.String filename, java.lang.String find, int startSearchPosition)
          Searches each line of a file to find a particular string.
static java.lang.String getAgentRelease()
          Retrieves the release of the IBM Installation Agent code base.
protected static java.lang.String getBackLevelDeployerMessage(java.lang.String methodName, java.lang.String sinceVersion)
          Obtains a back-level version message when an unavailable new API is called that is dependent on the version of the deployment wizard.
protected static java.lang.String getBackLevelJsdtMessage(java.lang.String methodName)
          Obtains a back-level version message when an unavailable new API is called.
static java.util.Locale getDeployerLocale()
          Retrieves the Locale of the deployment wizard so that a translatable message can be created for display.
static java.lang.String getDeploymentPackageJarName()
          Retrieves the deployment package JAR file name.
static java.lang.String getDeploymentWizardSpecificationVersion()
          Retrieves the specification-version of the deployment wizard.
static java.lang.String getDomain()
          Retrieves the domain suffix for the local host.
static java.lang.String getEntryResponseFilePath()
          Retrieves the name of the response file specified for the entry program prepended with the directory path containing the logs file.
static java.lang.String getEntryResponseFilePath(java.lang.String originalResponseFileName)
          Retrieves the name of the response file specified for the Entry program prepended with the logs directory path.
static java.lang.String getExitResponseFilePath()
          Retrieves the name of the response file specified for the exit program prepended with the directory path containing the log files.
static java.lang.String getExitResponseFilePath(java.lang.String originalResponseFilePath)
          Retrieves the name of the response file specified for the Exit program prepended with the logs directory.
static java.util.Locale getGroupLocale()
          Gets the locale of the installation group from the server.
static java.lang.String getHostName()
          Retrieves the unqualified local host name.
static java.lang.String getIbmNsiISMPPropValue(java.lang.String variable, java.lang.String propertyKeyType)
          Gets a value from the ibmnsi.properties file.
static java.util.Properties getIbmNsiProperties()
          Loads and retrieves the properties from the ibmnsi.properties file from disk.
static java.lang.String getIbmnsiPropertyKeyPrefix()
          Retrieves the appropriate key prefix for a value in the ibmnsi.properties file.
static java.lang.String getIbmNsiPropValue(java.lang.String variable)
          Gets a value from the ibmnsi.properties file.
static java.lang.String getIbmNsiPropValueByKey(java.lang.String key)
          Gets a value from the ibmnsi.properties file.
static java.lang.String[] getIimInstallLocationArray(java.lang.String packageId)
          Retrieves String array of installation locations of an installed product with a given package id from the IIM installed.xml file.
static java.lang.String[] getIimVersionArray(java.lang.String packageId)
          Retrieves String array of versions of an installed product with a given package id from the IIM installed.xml file.
static java.lang.String getKeyValue(java.lang.String key, java.lang.String responseFileName)
          Scans a file for a key and returns the string value found.
static java.lang.String getLogFileName()
          Gets the log file name that has been set directly by DeploymentHelper
static java.util.logging.Logger getLogger()
          Return a standard java.util.logging.Logger that can be used to log trace information to the support framework trace.
static java.lang.String getLogsDir()
          Gets the directory containing the logs files.
static java.lang.String getMainResponseFilePath()
          Retrieves the name of the response file specified for the main program prepended with the directory path containing the log files.
static java.lang.String getMainResponseFilePath(java.lang.String originalResponseFilePath)
          Retrieves the name of the response file specified for the Main program prepended with the logs directory.
static java.lang.String getOSType(java.lang.String os)
          Determines the operating system type for a given operating system
static long getPartitionCapacity(java.lang.String partition)
          Gets the capacity of a given drive on Windows or a partition on Linux.
static java.lang.String getPartitionFileSystemType(java.lang.String partition)
          Gets the file system type of a given drive on Windows or a mount point on Linux.
static java.lang.String getPartitionVolumeLabel(java.lang.String partition)
          Gets the volume label of a given drive on Windows or mount point on linux.
static java.lang.String getPasswordValue(java.lang.String passwordVariableName)
          Retrieves a password value for the currently installing application from the ibmnsi.properties file.
static java.lang.String getPasswordValueByKey(java.lang.String key)
          Retrieves a password value from the ibmnsi.properties file.
static java.lang.String getPreDeploymentCheckerResponseFilePath()
          Retrieves the name of the response file specified for the pre-deploymentChecker program prepended with the logs directory path.
static java.lang.String getPreDeploymentCheckerResponseFilePath(java.lang.String originalResponseFileName)
          Retrieves the name of the response file specified for the PreDeploymentChecker program prepended with the logs directory path.
static java.util.Properties getProductInstallingBundleProperties()
          Retrieves the Properties object loaded from the default properties bundle for the currently installing product.
static java.lang.String getProductInstallingId()
          Gets the application ID of the product currently installing on the target computer.
static java.lang.String getProductInstallingVersion()
          Retrieves the version of the currently installing application.
static java.lang.String getPropertyLogFileName()
          Gets the log file name stored in the ibmnsi.properties file.
static java.lang.String getQualifiedHostName()
          Retrieves the fully qualified local host name.
static java.util.List<java.lang.String> getQualifiedTiedPasswordValue(java.lang.String task, java.lang.String applicationId, java.lang.String variableKeyword)
          Returns a List of tied, password attribute values that correspond to the specified task, application ID and variable keyword.
static java.util.List<java.lang.String> getQualifiedTiedVariableValue(java.lang.String task, java.lang.String applicationId, java.lang.String variableKeyword)
          Returns a List of tied, host attribute values that correspond to the specified task, application ID and variable keyword.
static java.lang.String getResourceString(java.lang.String resourceBundle, java.lang.String key, java.lang.String... substitutions)
          Retrieves a translated message for the given key and substitution parameters in the given resource bundle.
static java.lang.String getResponseFilePath(int stage)
          Retrieves the name of the response file specified for the program prepended with the logs directory.
static java.lang.String getResponseFilePath(int stage, java.lang.String sourceName)
          Gets the qualifed, updated response file path for the specified original response file source name.
static java.util.Properties getResponseFileProperties(java.lang.String propertiesFilePath)
          Gets a property object populated by a Java properties formatted response file.
static java.lang.String getResponseFileProperty(java.lang.String propertiesFilePath, java.lang.String key)
          Gets a property value from a Java properties formatted response file.
static java.lang.String getResponseFileValue(java.lang.String responseFileName, java.lang.String key)
          Scans a response file for a key and returns the string value found.
static java.util.List<java.lang.String> getSelectedTaskList()
          Retrieves a List of the task IDs that have been selected for deployment in the deployment wizard.
static boolean getSetupFileRemovalSetting()
          Gets the setup file removal setting indicating whether or not the setup files will be removed at the completion of the installation.
static java.lang.String getStringFromCommandArray(java.lang.String[] cmdArray)
          Convenience method to assemble a command String from a String[] for logging purposes.
static java.lang.String getSystemEnvVar(java.lang.String variableName)
          Retrieves the value of a System environment variable.
static java.util.List<java.lang.String> getTaskApplicationList(java.lang.String taskId)
          Retrieves a List of the application IDs that were specified for deployment in the deployment wizard for the given task.
static java.util.List<java.lang.String> getTaskHostnameList(java.lang.String taskId)
          Retrieves a List of the hostnames that were specified for deployment in the deployment wizard for the given task.
static java.lang.String getTempDir()
          Determines and returns the temporary directory from the operating system environment.
static java.util.List<java.lang.String> getTiedPasswordValue(java.lang.String variableKeyword)
          Returns a List of tied, host password values that correspond to the variable keyword for the currently installing application.
static java.util.List<java.lang.String> getTiedPasswordValueForKey(java.lang.String key)
          Returns a List of tied, host password values that correspond to the specified key.
static java.util.List<java.lang.String> getTiedVariableValue(java.lang.String variableKeyword)
          Returns a List of tied, host attribute values that correspond to the variable keyword for the currently installing application.
static java.util.List<java.lang.String> getTiedVariableValueForKey(java.lang.String key)
          Returns a List of tied, host attribute values that correspond to the specified key.
static java.lang.String getTranslatedMessage(java.lang.String resourceKey, java.lang.String messageSubstitutionString, java.lang.String messageResourcePath, java.util.Locale locale)
          Retrieves a translatable message from a Locale specific ResourceBundle.
static java.lang.String getUnpackedDir()
          This method returns an absolute path to the unpacked directory with a slash appended to it.
static java.lang.String getVariableValueForTaskApplication(java.lang.String taskId, java.lang.String appId, java.lang.String variableKeyword)
          Retrieves the value of a variable.
static java.lang.String[] getVpdInstallLocationArray(java.lang.String vpdUid)
          Retrieves String array of installation locations of an installed product with a given UID from the ISMP vpd.properties file.
static java.util.ArrayList<java.lang.String> getVpdPropertyList(java.lang.String vpdUid, int vpdStartPipe, int vpdEndPipe)
          Retrieves a property from the ISMP vpd.properties file.
static java.lang.String[] getVpdVersionArray(java.lang.String vpdUid)
          Retrieves a String array of versions of an installed product with a given UID from the ISMP vpd.properties file.
static boolean isAix()
          Determines if the computer is running a AIX operating system.
static boolean isAixOSType(java.lang.String os)
          Determines if the operating system is a type of AIX operating system.
static boolean isApplicationVersionEqual(java.lang.String applicationVersion)
          Verifies that the specified version is equal to the version of the product currently installing.
static boolean isEnoughTargetDirSpaceAvailable(java.lang.String path, int sizeKBRequired)
          Determines the validity and free space of a destination directory stored in the ibmnsi.properties file.
static boolean isHPUX()
          Determines if the computer is running a HP-UX operating system.
static boolean isHPUXOSType(java.lang.String os)
          Determines if the operating system is a type of HP-UX operating system.
static boolean isIpv6Address(java.lang.String computerName)
          Indicates whether or not the specified computer name is an IPv6 address.
static boolean isLinux()
          Determines if the computer is running a Linux operating system.
static boolean isLinuxOSType(java.lang.String os)
          Determines if the operating system is a type of Linux operating system.
static boolean isLinuxX86_32()
          Determines if the machine is running 32-bit Linux on x86
static boolean isLinuxX86_64()
          Determines if the machine is running 64-bit Linux on x86
static boolean isOS400()
          Determines if the computer is running a OS/400 or iSeries operating system.
static boolean isOS400OSType(java.lang.String os)
          Determines if the operating system is a type of OS/400 or iSeries operating system.
static boolean isPortOpen(int portNumber)
          Verifies that a TCP/IP port is not in use.
static boolean isPortRegistered(int port)
          Checks the operating system services file to see if the port is already registered.
static boolean isPowerLinuxOSType(java.lang.String os)
          Determines if the operating system is a type of Linux on POWER operating system
static boolean isSameDirectoryName(java.lang.String location1, java.lang.String location2)
          Compares two directories to see if they are the same.
static boolean isSunOS()
          Determines if the computer is running a Solaris operating system.
static boolean isSunOSType(java.lang.String os)
          Determines if the operating system is a type of Solaris operating system.
static boolean isVersionSupported(java.lang.String version, java.lang.String lowestSupportedVersion, java.lang.String highestSupportedVersion)
          Determines if the version specified falls within the boundary of the lowest supported version and highest supported version.
static boolean isWindows()
          Determines if the computer is running a Windows operating system.
static boolean isWindowsOSType(java.lang.String os)
          Determines if the operating system is a type of Windows operating system.
static boolean log(java.lang.String message)
          Writes a message to a log file.
static void log(java.lang.String message, java.lang.String logFileName)
          Writes the message, the timestamp and separator string to the log file specified in the logFileName
static OperationStatus logAppendFile(java.lang.String fileToAppendPath)
          This method provides a supported mechanism for adding the contents of a file to the log.
static OperationStatus logAppendFile(java.lang.String[] fileNames)
          Appends the content of each file listed in the array to the deployment wizard log file.
static void logNewLine()
          Writes a blank line to the log file.
static void logStatus(boolean isInstallSuccessful)
          Writes a success or failure message to a log file prepended with a timestamp and "****INSTALLATION STATUS = ".
static boolean modifyResponseFile(java.lang.String key, java.lang.String value, java.lang.String responseFileName)
          Changes a value in a response file.
static void postCompletionMessageToDeployerUI(java.lang.String message)
          Overrides the default completion message to the deployment wizard on the "Detailed Messages" panel.
static void postErrorMessageToDeployerMainUI(java.lang.String message)
          Posts a message with an error icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.
static void postErrorMessageToDeployerUI(java.lang.String message)
          Posts a message with an error icon to the deployment wizard on the "Detailed Messages" panel.
static void postInformationMessageToDeployerMainUI(java.lang.String message)
          Posts a message with an information icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.
static void postInformationMessageToDeployerUI(java.lang.String message)
          Posts a message with an information icon to the deployment wizard on the "Detailed Messages" panel.
static void postSuccessMessageToDeployerMainUI(java.lang.String message)
          Posts a message with a success icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.
static void postSuccessMessageToDeployerUI(java.lang.String message)
          Posts a message with a success icon to the deployment wizard on the "Detailed Messages" panel.
static void postWarningMessageToDeployerMainUI(java.lang.String message)
          Posts a message with a warning icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.
static void postWarningMessageToDeployerUI(java.lang.String message)
          Posts a message with a warning icon to the deployment wizard on the "Detailed Messages" panel.
static java.lang.String readFile(java.lang.String filePathName)
          Reads in a file.
static java.lang.String removeAlphaCharsFromString(java.lang.String inputString)
          Removes all characters that are not 0 -9 or '.' from the input string and returns the resulting value.
static java.lang.String replaceSubstring(java.lang.String targetString, java.lang.String oldSubstring, java.lang.String newSubstring)
          Modifies a String by replacing a substring with a new substring.
protected static int runAs(java.lang.String userId, java.lang.String password, java.lang.String command)
          Runs the command on the local computer as the specified user.
protected static int runAs(java.lang.String userId, java.lang.String password, java.lang.String command, boolean shouldLogOutput)
          Runs the command on the local computer as the specified user.
static OperationStatus setIbmNsiProperty(java.lang.String key, java.lang.String value)
          Sets a property into the currently cached ibmnsi Properties object and saves the updated properties to disk.
static boolean setKeyValue(java.lang.String key, java.lang.String value, java.lang.String responseFileName, boolean createKeyIfDoesNotExist)
          Scans a file for a key and sets the corresponding value.
static void setLogFileName(java.lang.String name)
          Set the log file name if it is not set by ibmnsi.properties
 void setMainResources(java.lang.String myResources)
          Set the name of the main ResourceBundle.
static boolean setResponseFileProperty(java.lang.String propertiesFilePath, java.lang.String key, java.lang.String value)
          Sets a property value into a Java properties formatted response file.
static boolean setResponseFileValue(java.lang.String responseFileName, java.lang.String key, java.lang.String keyValue, boolean createKeyIfDoesNotExist)
          Scans a response file for a key and sets the corresponding value.
static void trace(java.lang.Object object)
          Deprecated.  
static void trace(java.lang.Object[] objects)
          Deprecated.  
static void trace(java.lang.String text)
          Deprecated.  
static java.lang.String trimDoubleQuotes(java.lang.String inputString)
          Removes quotation marks from a string.
static boolean unPackJar(java.lang.String absolutePathName, java.lang.String destinationDirPath)
          Unpacks a JAR file.
static boolean valueExists(java.lang.String stringToSearch, java.lang.String[] values)
          Determines if any of the given values exist in a given string.
static boolean waitForFile(int timeOutInSec, int timeIntervalInSec, java.lang.String filePath, java.lang.String[] successStrings, java.lang.String[] failureStrings)
          Polls the system for the existence of a file and, optionally, strings within the file.
static OperationStatus writeFile(java.lang.String filePathName, java.lang.String message, boolean append)
          Writes a String to a file, appends it to the file or overwrites the file.
 
Methods inherited from class com.ibm.jsdt.common.Base
getBuildPropertiesAccessor, getFullVersion, getMainResources, getResourceString, getResourceString, getResourceString, getResourceString, getResourceString, getResourceStringArray, getResourceStringArray, showBuildProperties, showFullVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
See Also:
Constant Field Values

VPD_INSTALL_LOCATION_PIPE

public static final int VPD_INSTALL_LOCATION_PIPE
See Also:
Constant Field Values

VPD_VERSION_PIPE

public static final int VPD_VERSION_PIPE
See Also:
Constant Field Values

DEPLOYER_SPECIFICATION_VERSION_KEY

public static final java.lang.String DEPLOYER_SPECIFICATION_VERSION_KEY
See Also:
Constant Field Values

SELECTED_TASK_NAMES_KEY

public static final java.lang.String SELECTED_TASK_NAMES_KEY
See Also:
Constant Field Values

resourceBundle

public static final java.lang.String resourceBundle
See Also:
Constant Field Values

VERSIONCHECKER_STAGE

protected static final int VERSIONCHECKER_STAGE
See Also:
Constant Field Values

ENTRY_STAGE

protected static final int ENTRY_STAGE
See Also:
Constant Field Values

MAIN_STAGE

protected static final int MAIN_STAGE
See Also:
Constant Field Values

EXIT_STAGE

protected static final int EXIT_STAGE
See Also:
Constant Field Values

SUCCESS

public static final int SUCCESS
See Also:
Constant Field Values

FAILURE

public static final int FAILURE
See Also:
Constant Field Values

PDC_DO_NOT_INSTALL

public static final int PDC_DO_NOT_INSTALL
See Also:
Constant Field Values

PDC_CANCEL_INSTALL

public static final int PDC_CANCEL_INSTALL
See Also:
Constant Field Values

PDC_EXISTS

public static final int PDC_EXISTS
See Also:
Constant Field Values

PDC_DOES_NOT_EXIST

public static final int PDC_DOES_NOT_EXIST
See Also:
Constant Field Values

sNEWLN

public static final java.lang.String sNEWLN
System independent line separator.


ISMP_GLOBAL_PROPERTY

public static final java.lang.String ISMP_GLOBAL_PROPERTY
See Also:
Constant Field Values

ISMP_WIZARD_PROPERTY

public static final java.lang.String ISMP_WIZARD_PROPERTY
See Also:
Constant Field Values

ISMP_PRODUCT_PROPERTY

public static final java.lang.String ISMP_PRODUCT_PROPERTY
See Also:
Constant Field Values
Constructor Detail

DeploymentHelper

public DeploymentHelper()
Method Detail

copyDirectory

public static OperationStatus copyDirectory(java.lang.String source,
                                            java.lang.String target)
Copies a directory tree from the source to the target. If the target directory does not exist, an attempt will be made to create it.

Parameters:
source - -The absolute path to the source directory.
target - -The absolute path to the target directory.
Returns:
OperationStatus -The status of the operation. Check isOK() method for success/failure.

copyFile

public static OperationStatus copyFile(java.lang.String source,
                                       java.lang.String target)
This method copies a file to another location. The copy is performed through Java (Buffered) streams, and therefore the file can be of any type (text, binary and so on).

NOTE: If a file of the same name already exists in the target directory, it will be overwritten. If the target directory does not exist it will be created. The source file and target directory should not be encapsulated in quotation marks.

Parameters:
source - -The absolute path and name of the source file.
target - -The absolute path to the target directory.
Returns:
OperationStatus -The status of the operation. Check isOK() method for success or failure

copyAndRenameFile

public static OperationStatus copyAndRenameFile(java.lang.String source,
                                                java.lang.String target,
                                                java.lang.String newName)
Copies a file to another location and renames the file in the new target location. The copy is performed through Java (Buffered) streams and therefore the file can be of any type (text,binary and so on).

NOTE: If a file of the same name already exists in the target directory, it will be overwritten. If the target directory does not exist it will be created. The source file, target directory and target file name should not be encapsulated in quotation marks.

Parameters:
source - - source file path
target - - target file path
newName - - a new file name.
Returns:
OperationStatus -The status of the operation. Check isOK() method for success or failure.

deleteFile

public static OperationStatus deleteFile(java.lang.String pathname)
Deletes a file. Deletes the specified file from the file system.

Parameters:
pathname - -path to file. If pathname denotes a directory, then the directory must be empty.
Returns:
OperationStatus -the status of the operation. Check isOK() for success or failure.

fileExists

public static boolean fileExists(java.lang.String pathname)
Checks for existence of a file.

Parameters:
pathname - - a file path name.
Returns:
A boolean
  • true if the file exists.
  • false otherwise.

endOfFileScan

public static OperationStatus endOfFileScan(java.lang.String filePathName,
                                            java.lang.String searchString,
                                            int numOfCharsToSearch)
Scans a file for a string, starting from the end.

Parameters:
filePathName - -the absolute path of the file to be searched.
searchString - -the string to search for in the file, starting from the end of the file.
numOfCharsToSearch - -designates the number of characters to search for, starting from the end. For example, if 100 is specified, then only the last 100 characters of the file are scanned for the search string. If the number specified is greater than the total character count in the file, the entire file will be scanned.
Returns:
OperationStatus -the status of the operation. If isOK()method returns true, then the string was found.

fileScan

public static OperationStatus fileScan(java.lang.String filePathName,
                                       java.lang.String searchString,
                                       int startIndex)
Scans a file for a string.

Parameters:
filePathName - -the absolute file path to scan
searchString - -the string to search for in the file
startIndex - - designates the starting index from which to begin searching in the file. Zero marks the beginning.
Returns:
OperationStatus the status of the operation. If isOK() method returns true, the string was found.

getKeyValue

public static java.lang.String getKeyValue(java.lang.String key,
                                           java.lang.String responseFileName)
Scans a file for a key and returns the string value found. This is a generic function that retrieves the value (right side) in a "key = value" pair in a given text based file. Note: If this is a response file, typically, you can prepend the response file name with the return value from getLogsDir() which is an absolute path to the logs directory.

Parameters:
key - -the response file key to search for
responseFileName - -the response file absolute path with name
Returns:
The String found for the key

setKeyValue

public static boolean setKeyValue(java.lang.String key,
                                  java.lang.String value,
                                  java.lang.String responseFileName,
                                  boolean createKeyIfDoesNotExist)
Scans a file for a key and sets the corresponding value.

This function will set or replace a value in a file. The value (right side) must be part of a "key = value" pair. The "key = value" pair must be on the same line in the text based file. The line must start with the var/key (In other word, no preceding asterisks or blank spaces and so on). Note: If this is a response file, typically, you can prepend the file name with the return value from getLogsDir() which is an absolute path to the logs directory (which also contains response files).

Parameters:
key - -The key to search for.
value - -The value to set for the specified key in the response file.
responseFileName - -The absolute path to the response file, including the name.
createKeyIfDoesNotExist - -Set this to true if a key should be created if one does not exist.
Returns:
A boolean value of
  • true if the operation was successful
  • false if the operation failed

getLogsDir

public static java.lang.String getLogsDir()
Gets the directory containing the logs files. This function returns an absolute path to the logs directory with a slash appended to it. The logs directory contains response files, properties files, and log files for the products that will be installed.

Returns:
Path to the logs directory

getAgentRelease

public static java.lang.String getAgentRelease()
Retrieves the release of the IBM Installation Agent code base.

For example, it would return 2.1.0.0, not 3.1.0.0 for IR 2.1.

It will return null for releases prior to IR 2.1 .

NOTE: This is not the same as the version number of the IBM Installation Agent.

Returns:
String

getDeploymentPackageJarName

public static java.lang.String getDeploymentPackageJarName()
Retrieves the deployment package JAR file name.

The value is retrieved as a non-translatable property.

Returns:
String

getIbmnsiPropertyKeyPrefix

public static java.lang.String getIbmnsiPropertyKeyPrefix()
Retrieves the appropriate key prefix for a value in the ibmnsi.properties file.

For release IR 2.1 and later, the prefix is the application ID. Earlier releases used the deployment package JAR file name.

Returns:
String

getPropertyLogFileName

public static java.lang.String getPropertyLogFileName()
Gets the log file name stored in the ibmnsi.properties file.

Returns:
The log file name retrieved from the ibmnsi.properties file

setLogFileName

public static void setLogFileName(java.lang.String name)
Set the log file name if it is not set by ibmnsi.properties

Parameters:
name - The log file name is set directly by DeploymentHelper instead get from ibmnsi.properties file.

getLogFileName

public static java.lang.String getLogFileName()
Gets the log file name that has been set directly by DeploymentHelper

Returns:
logFileName

determineLogFileName

public static java.lang.String determineLogFileName()
Determines the name of the log file

  • If the application deployment accelerator specified a log file name it will be retrieved from the ibmnsi.properties.
  • Otherwise, check if a log file name has been set in DeploymentHelper.
  • If this was not set, then a default name of productInstallingId.log is used.

    Returns:
    String the log file name with ".log" appended

  • modifyResponseFile

    public static boolean modifyResponseFile(java.lang.String key,
                                             java.lang.String value,
                                             java.lang.String responseFileName)
    Changes a value in a response file.

    This function will set or replace a value in a file. The value (right side) must be part of a "key = value" pair. The "key = value" pair must be on the same line in the text based file. The line must start with the var/key (In other word, no preceding asterisks or blank spaces and so on). Note: Typically, you can prepend the response file name with the return value from getLogsDir() which is an absolute path to the logs directory (which also contains response files).

    This method is the same as setKeyValue with the exception that it does not take a fourth parameter to determine whether or not to create the key if it does not exist. The key will not be created if not found. To create the key, use setKeyValue with the option to create key set to true.

    Parameters:
    key - -The key to search for.
    value - -The value to set for the specified key in the response file.
    responseFileName - -The absolute path to the response file, including the file name.
    Returns:
    A boolean value of
    • true if the operation was successful
    • false if the operation failed

    readFile

    public static java.lang.String readFile(java.lang.String filePathName)
                                     throws java.io.IOException
    Reads in a file. This function reads the entire contents of a file into one string.

    Parameters:
    filePathName - -The absolute file path, including the file name.
    Returns:
    String -The contents of the file
    Throws:
    java.io.IOException - the file cannot be read

    writeFile

    public static OperationStatus writeFile(java.lang.String filePathName,
                                            java.lang.String message,
                                            boolean append)
    Writes a String to a file, appends it to the file or overwrites the file. If append is set to true it will append the string. If it is set to false, it will overwrite the old contents of the file with this new string. If the file does not already exist, it will be created.

    Parameters:
    filePathName - -The path (including the file name) to the file to be written.
    message - -The string message to write to the file.
    append - -Determines whether to append the string to the file, or overwrite it.
    Returns:
    OperationStatus -The status of the operation. If isOK() returns true, the operation was successful.

    getUnpackedDir

    public static java.lang.String getUnpackedDir()
    This method returns an absolute path to the unpacked directory with a slash appended to it. This is the directory where images are unpacked. The unpacked directory contains all of the files exploded from the deployment package for the product, including entry, exit, main, and pre-deployment programs, as well as any other files specified in the application deployment accelerator.

    Returns:
    The path to the unpacked directory with a slash appended to it

    isPortOpen

    public static boolean isPortOpen(int portNumber)
    Verifies that a TCP/IP port is not in use. If port usage information cannot be obtained, a default of true is returned.

    Parameters:
    portNumber - -The port number to check.
    Returns:
    A boolean value of
    • true if the port is not in use or if usage cannot be determined
    • false if the port is in use

    checkFreeSpaceAvailable

    public static long checkFreeSpaceAvailable(java.lang.String path)
    Gets the amount of free disk space in a path. This function will return the amount of free space available in kilobytes.

    WINDOWS: You must pass a path prepended with a drive letter and a colon (For example, c:).

    LINUX: You must pass a fully qualified path to the mount point or directory (For example, /usr). If /usr is passed and is itself a mount point the return value will be the amount of free space available in /usr. If /usr is not actually a mount point, the return value will be the amount of free space in the filesystem on which the /usr resides. In this example, the amount of free space on "/" (root) would be returned. Therefore, you can check the available free space in the target directory without knowing beforehand whether or not the target is a mount point.

    Parameters:
    path - -The absolute path to check for free space.
    Returns:
    long the amount of free space in KB

    0 will be returned if the directory does not exist, or if the drive or mount point passed is not valid or not in the appropriate format


    checkTargetDirectory

    public static long checkTargetDirectory(java.lang.String path)
    Determines the validity of a destination directory stored in the ibmnsi.properties file. If the directory does not already exist, it will be created. If the directory does not exist and cannot be created, the drive is not valid and the method will return 0. If the directory exists, the free space of the drive or mount point that contains the directory will be returned. The function will return long representing the kilobytes of free space available. A return of 0 indicates no space available or an invalid directory.

    Parameters:
    path - -The absolute path to check
    Returns:
    A long
    • 0 - no space available or directory is not valid
    • n - the amount of available free space in kilobytes

    isEnoughTargetDirSpaceAvailable

    public static boolean isEnoughTargetDirSpaceAvailable(java.lang.String path,
                                                          int sizeKBRequired)
    Determines the validity and free space of a destination directory stored in the ibmnsi.properties file. If the directory does not already exist, it will be created.

    Parameters:
    path - -the absolute path to check
    sizeKBRequired - -an integer representing the kilobytes of space required
    Returns:
    A boolean value of
    • true if there is enough free space to install to the target directory
    • false if there is not enough free space

    waitForFile

    public static boolean waitForFile(int timeOutInSec,
                                      int timeIntervalInSec,
                                      java.lang.String filePath,
                                      java.lang.String[] successStrings,
                                      java.lang.String[] failureStrings)
    Polls the system for the existence of a file and, optionally, strings within the file. It will pause the current thread for the specified number of seconds each time the specified file or string within the file is not found. The purpose of this function is to allow synchronization (Linux or Windows) of the installation program for a deployment accelerator with the particular product's installation program. The creation of a particular file can be taken as an indicator that the installation routine for a product is complete. If success or failure string are specified the function will continue to poll until one of the strings is found or the timeout expires.

    NOTE: In most cases, a check for (old) previous versions of the file should be performed and the (old) file should be deleted before invoking this function.

    TimeOutInSec specifies the total time to wait for the specified conditions. The function will return false if conditions are not met in the allotted time. A negative timeout value indicates an "infinite" timeout. Interval specifies the number of seconds between checks for file existence and strings.

    Parameters:
    timeOutInSec - - Specifies the total time in seconds to wait for the specified conditions. The function will return falsetimeIntervalInSec - - The number of seconds between checks for file existence and strings (if any specified).
    filePath - - The absolute path and name of the file.
    successStrings - - Can be null (optional). An array of String(s) which indicate success if found in the file.
    failureStrings - - Can be null (optional). An array of String(s) which indicate failure if found in the file.
    Returns:
    A boolean value of
    • true if the file is found (created) and the successs and fail strings are null or the success string is found.
    • false if a timeout occurs or if the fail string is found.

    executeCommand

    public static ProgramOutput executeCommand(java.lang.String cmdLaunchDir,
                                               java.lang.String[] commandEnvironmentArray,
                                               boolean isLocalInteractive,
                                               boolean waitForOutput,
                                               java.lang.String commandToLog,
                                               java.lang.String command)
    Executes the specified command in a separate process through Runtime.exec() with the specified environment and working directory and waits for it to finish. Return values can be obtained from the ProgramOutput object returned by this method.

    Note:

    The string “cmd /C “ is added to the beginning of the command for Windows platforms.

    The string "/bin/sh -c" is added to Linux, HP, AIX and Solaris platforms.

    The Wait For Completion property must be checked for the corresponding user program if the program being launched locally is an interactive program.

    Parameters:
    cmdLaunchDir - -Can be null (optional). Specifies the working directory path. If null, the current working directory of the current process is used.
    commandEnvironmentArray - - The environment array can be null . If the environment array is null, the current environment of the calling process is used.
    isLocalInteractive - -Set to true if the command being launched is an interactive local program.
    waitForOutput - -Set to true to indicate execution should be paused to ensure that the command output is captured in its entirety.
    commandToLog - -If the command contains sensitive data, set the command to log here. If left null, the regular command will be logged.
    command - -Command to launch
    Returns:
    ProgramOutput The program output. It contains information about the command's stderr, stdout, return code, and exception thrown (if any).

    getSystemEnvVar

    public static java.lang.String getSystemEnvVar(java.lang.String variableName)
    Retrieves the value of a System environment variable. If the value is not set or the environment variable does not exist, the function will return null.

    Parameters:
    variableName - - The variable name in the system environment.
    Returns:
    A String indicating the value of the environment variable

    getGroupLocale

    public static java.util.Locale getGroupLocale()
    Gets the locale of the installation group from the server. The locale information will be obtained from the ibmnsi.properties file. It will return the default locale of the current machine if a value cannot be obtained from the ibmnsi.properties file.

    Returns:
    Locale -The locale of the group directory

    replaceSubstring

    public static java.lang.String replaceSubstring(java.lang.String targetString,
                                                    java.lang.String oldSubstring,
                                                    java.lang.String newSubstring)
    Modifies a String by replacing a substring with a new substring.

    Parameters:
    targetString - -The string to be modified.
    oldSubstring - -The substring to be replaced
    newSubstring - -The replacement substring
    Returns:
    A String resulting from replacing all occurrences of the oldSubstring in the targetString with the newSubstring

    getProductInstallingId

    public static java.lang.String getProductInstallingId()
    Gets the application ID of the product currently installing on the target computer.

    Returns:
    The application ID

    getHostName

    public static java.lang.String getHostName()
    Retrieves the unqualified local host name.

    Returns:
    A String indicate the host name

    getDomain

    public static java.lang.String getDomain()
    Retrieves the domain suffix for the local host.

    Example: raleigh.ibm.com

    Returns:
    A String indicating the domain of the local host

    fileSearchAndReplace

    public static int fileSearchAndReplace(java.lang.String filePathName,
                                           java.lang.String findString,
                                           java.lang.String replaceString,
                                           boolean ignoreCase,
                                           boolean createBackup)
    Performs a find and replace in a given file. Replaces all occurrences of the "find" substring with the "replace" substring in the specified file. Note: This method will not ignore whitespace.

    Parameters:
    filePathName - -the absolute path to the file including the file name.
    findString - -the substring to be replaced.
    replaceString - -the substring to use for replacement.
    ignoreCase - -set to true if case should be ignored when searching.
    createBackup - -set to true if a backup of original file should be created.
    Returns:
    An integer indicating the number of replacements made. -1 is return if errors occurred.

    fileSearchAndReplaceLine

    public static int fileSearchAndReplaceLine(java.lang.String filePathName,
                                               java.lang.String findLine,
                                               java.lang.String replaceLine,
                                               boolean ignoreCase,
                                               boolean ignoreWhitespace,
                                               boolean createBackup)
    Performs a find and replace of a line in the specified file.

    Parameters:
    filePathName - -the absolute path to the file (including file name)
    findLine - -the line to search for
    replaceLine - -the replacement line
    ignoreCase - -set to true if case should be ignored when searching.
    ignoreWhitespace - -set to true if whitespace should be ignored when searching.
    createBackup - -set to true if a backup of original file should be created.
    Returns:
    An integer indicating the number of replacements made. -1 is returned if errors occurred

    postSuccessMessageToDeployerUI

    public static void postSuccessMessageToDeployerUI(java.lang.String message)
    Posts a message with a success icon to the deployment wizard on the "Detailed Messages" panel.

    Parameters:
    message - -the translated, substituted message to post

    postSuccessMessageToDeployerMainUI

    public static void postSuccessMessageToDeployerMainUI(java.lang.String message)
    Posts a message with a success icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.

    Parameters:
    message - -the translated, substituted message to post

    postInformationMessageToDeployerUI

    public static void postInformationMessageToDeployerUI(java.lang.String message)
    Posts a message with an information icon to the deployment wizard on the "Detailed Messages" panel.

    Parameters:
    message - -the translated, substituted message to post

    postInformationMessageToDeployerMainUI

    public static void postInformationMessageToDeployerMainUI(java.lang.String message)
    Posts a message with an information icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.

    Parameters:
    message - -the translated, substituted message to post

    postWarningMessageToDeployerUI

    public static void postWarningMessageToDeployerUI(java.lang.String message)
    Posts a message with a warning icon to the deployment wizard on the "Detailed Messages" panel.

    Parameters:
    message - -the translated, substituted message to post

    postWarningMessageToDeployerMainUI

    public static void postWarningMessageToDeployerMainUI(java.lang.String message)
    Posts a message with a warning icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.

    Parameters:
    message - -the translated, substituted message to post

    postErrorMessageToDeployerUI

    public static void postErrorMessageToDeployerUI(java.lang.String message)
    Posts a message with an error icon to the deployment wizard on the "Detailed Messages" panel.

    Parameters:
    message - -the translated, substituted message to post

    postErrorMessageToDeployerMainUI

    public static void postErrorMessageToDeployerMainUI(java.lang.String message)
    Posts a message with an error icon to the deployment wizard on the "Detailed Messages" panel, and also on the "Status" panel.

    Parameters:
    message - -the translated, substituted message to post

    postCompletionMessageToDeployerUI

    public static void postCompletionMessageToDeployerUI(java.lang.String message)
    Overrides the default completion message to the deployment wizard on the "Detailed Messages" panel. The user program must actually exit the installation in order to cause the message to display.

    Parameters:
    message - -the translated, substituted message to post

    getTranslatedMessage

    public static java.lang.String getTranslatedMessage(java.lang.String resourceKey,
                                                        java.lang.String messageSubstitutionString,
                                                        java.lang.String messageResourcePath,
                                                        java.util.Locale locale)
    Retrieves a translatable message from a Locale specific ResourceBundle.

    Parameters:
    resourceKey - -key to find the translated string in the given resource bundle.
    messageSubstitutionString - -string with all of the parameter substitutions comma delimited.
    messageResourcePath - -dotted classpath of a translated message's ResourceBundle. For example, "com.ibm.jsdt.main.MainManagerNLS".
    locale - -message locale.
    Returns:
    A String indicating the translated message

    getDeployerLocale

    public static java.util.Locale getDeployerLocale()
    Retrieves the Locale of the deployment wizard so that a translatable message can be created for display.

    Returns:
    Locale

    isApplicationVersionEqual

    public static boolean isApplicationVersionEqual(java.lang.String applicationVersion)
    Verifies that the specified version is equal to the version of the product currently installing.

    Parameters:
    applicationVersion - -the version to check for
    Returns:
    Aboolean value of
    • true if the specified version is equal to the version of the product currently installing.
    • false otherwise.

    getProductInstallingVersion

    public static java.lang.String getProductInstallingVersion()
    Retrieves the version of the currently installing application.

    Returns:
    A String indicating the version of the application.

    getStringFromCommandArray

    public static java.lang.String getStringFromCommandArray(java.lang.String[] cmdArray)
    Convenience method to assemble a command String from a String[] for logging purposes.

    Parameters:
    cmdArray - -Array to convert to string
    Returns:
    A String

    getIbmNsiProperties

    public static java.util.Properties getIbmNsiProperties()
    Loads and retrieves the properties from the ibmnsi.properties file from disk.

    The Properties object is not cached because changes are frequently written to disk.

    Returns:
    Properties

    getIimInstallLocationArray

    public static java.lang.String[] getIimInstallLocationArray(java.lang.String packageId)
    Retrieves String array of installation locations of an installed product with a given package id from the IIM installed.xml file.

    The return will be null if the package id is not found.

    Parameters:
    String - package id
    Returns:
    String array of installation locations or null.

    getIimVersionArray

    public static java.lang.String[] getIimVersionArray(java.lang.String packageId)
    Retrieves String array of versions of an installed product with a given package id from the IIM installed.xml file.

    The return will be null if the package id is not found.

    Parameters:
    String - package id
    Returns:
    String array of versions or null.

    getVpdPropertyList

    public static java.util.ArrayList<java.lang.String> getVpdPropertyList(java.lang.String vpdUid,
                                                                           int vpdStartPipe,
                                                                           int vpdEndPipe)
    Retrieves a property from the ISMP vpd.properties file.

    Parameters:
    vpdUid - -the uid of the product for which the VPD property value is sought.
    vpdStartPipe - -the number of the first pipe character that delimits the sought VPD property.
    vpdEndPipe - -the number of the last pipe character that delimits the sought VPD property.
    Returns:
    A String indicating the property value.

    getVpdInstallLocationArray

    public static java.lang.String[] getVpdInstallLocationArray(java.lang.String vpdUid)
    Retrieves String array of installation locations of an installed product with a given UID from the ISMP vpd.properties file.

    The return will be null if the UID is not found in the properties file.

    It is assumed that the pipe number for the installation location information is 12.

    Parameters:
    vpdUid - -the Uid of the product
    Returns:
    A String[] indicating the install locations.

    getVpdVersionArray

    public static java.lang.String[] getVpdVersionArray(java.lang.String vpdUid)
    Retrieves a String array of versions of an installed product with a given UID from the ISMP vpd.properties file.

    The return will be null if the UID is not found in the properties file.

    It is assumed that the pipe number for the version information is 5.

    Parameters:
    vpdUid - -the UID for the product
    Returns:
    A String[] indicating the version of the installed product

    compareVersions

    public static int compareVersions(java.lang.String version,
                                      java.lang.String compareVersion)
    Compares two dotted version strings.

    The compared version strings must be comprised of only dots and numbers.

    Parameters:
    version - -the application version
    compareVersion - -the application version to compare
    Returns:
    An integer with one of the following four possible return values:
    • 0 indicates versions are equal
    • 1 indicates version is "greater" than compareVersion
    • -1 indicates version is "less" than compareVersion
    • Integer.MIN_VALUE if version or compareVersion contains characters other than dots and numbers.

    getProductInstallingBundleProperties

    public static java.util.Properties getProductInstallingBundleProperties()
    Retrieves the Properties object loaded from the default properties bundle for the currently installing product.

    Returns:
    Properties

    getSelectedTaskList

    public static java.util.List<java.lang.String> getSelectedTaskList()
    Retrieves a List of the task IDs that have been selected for deployment in the deployment wizard.

    If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

    The task ID is an optional attribute in the solution XML. If tasks are selected that do not have an ID specified, they will be identified by a number. The number is a one-based index derived from the order of appearance in the solution XML.

    The ordering of the tasks in the solution XML is preserved in the List.

    Returns:
    List

    getVariableValueForTaskApplication

    public static java.lang.String getVariableValueForTaskApplication(java.lang.String taskId,
                                                                      java.lang.String appId,
                                                                      java.lang.String variableKeyword)
    Retrieves the value of a variable. The value is obtained by fully qualifying the specified variable with the task ID and the application ID.

    The SupportBase to be queried must invoke setVariableKeyword and setApplicationId , setTaskId before calling this method.

    Parameters:
    taskId - -the task ID
    appId - -the application ID
    variableKeyword - -the keyword specified for the variable
    Returns:
    A String indicating the value of the variable.

    getTaskHostnameList

    public static java.util.List<java.lang.String> getTaskHostnameList(java.lang.String taskId)
    Retrieves a List of the hostnames that were specified for deployment in the deployment wizard for the given task.

    If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

    The task ID is an optional attribute in the solution XML. If tasks are selected that do not have an ID specified, they will be identified by a number. The number is a one-based index derived from the order of appearance in the solution XML.

    Parameters:
    taskId - - a task ID
    Returns:
    A List of host names.

    getTaskApplicationList

    public static java.util.List<java.lang.String> getTaskApplicationList(java.lang.String taskId)
    Retrieves a List of the application IDs that were specified for deployment in the deployment wizard for the given task.

    If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

    The task ID is an optional attribute in the solution XML. If tasks are selected that do not have an ID specified, they will be identified by a number. The number is a one-based index derived from the order of appearance in the solution XML.

    Parameters:
    taskId - - the task ID
    Returns:
    A List of the application IDs specified for deployment

    setIbmNsiProperty

    public static OperationStatus setIbmNsiProperty(java.lang.String key,
                                                    java.lang.String value)
    Sets a property into the currently cached ibmnsi Properties object and saves the updated properties to disk.

    Parameters:
    key - -the key to add in the list of properties
    value - -the corresponding value of the key
    Returns:
    OperationStatus -the status of the operation. If isOK() returns true, the operation was successful. Check getException() for any exceptions that might have occurred.

    getPartitionFileSystemType

    public static java.lang.String getPartitionFileSystemType(java.lang.String partition)
    Gets the file system type of a given drive on Windows or a mount point on Linux.

    Note: This method is not supported on AIX or iSeries systems.

    The path format on Windows must be C:\\, where C is the drive letter.

    Parameters:
    partition - - drive in Windows (For example, C:\\) or a mount point in Linux
    Returns:
    A String indicating the file system type

    getPartitionVolumeLabel

    public static java.lang.String getPartitionVolumeLabel(java.lang.String partition)
    Gets the volume label of a given drive on Windows or mount point on linux.

    Note: This method is not supported on AIX or iSeries systems.

    The path format on Windows must be C:\\, where C is the drive letter.

    Parameters:
    partition - - drive in Windows (For example, C:\\) or a mount point in Linux
    Returns:
    A String indicating the volume label

    getPartitionCapacity

    public static long getPartitionCapacity(java.lang.String partition)
    Gets the capacity of a given drive on Windows or a partition on Linux.

    Note: This method is not supported on AIX or iSeries systems.

    Parameters:
    partition - -drive on Windows (For example: C:\\) or a partition on Linux
    Returns:
    The capacity of the drive or the partition.

    isWindows

    public static boolean isWindows()
    Determines if the computer is running a Windows operating system.

    Returns:
    A Boolean value of
    • true if operating system is Windows
    • false if operating system is not Windows

      isLinux

      public static boolean isLinux()
      Determines if the computer is running a Linux operating system.

      Returns:
      A Boolean value of
      • true if operating system is Linux
      • false if operating system is not Linux

        isLinuxX86_64

        public static boolean isLinuxX86_64()
        Determines if the machine is running 64-bit Linux on x86

        Returns:
        A Boolean value of
        • true if operating system is 64-bit Linux
        • false if operating system is not 64-bit Linux

          isLinuxX86_32

          public static boolean isLinuxX86_32()
          Determines if the machine is running 32-bit Linux on x86

          Returns:
          A Boolean value of
          • true if operating system is 32-bit Linux
          • false if operating system is not 32-bit Linux

            isSunOS

            public static boolean isSunOS()
            Determines if the computer is running a Solaris operating system.

            Returns:
            A Boolean value of
            • true if operating system is Solaris
            • false if operating system is not Solaris

              isHPUX

              public static boolean isHPUX()
              Determines if the computer is running a HP-UX operating system.

              Returns:
              A Boolean value of
              • true if operating system is HP-UX
              • false if operating system is not HP-UX

                isAix

                public static boolean isAix()
                Determines if the computer is running a AIX operating system.

                Returns:
                A Boolean value of
                • true if operating system is AIX
                • false if operating system is not AIX

                  isOS400

                  public static boolean isOS400()
                  Determines if the computer is running a OS/400 or iSeries operating system.

                  Returns:
                  A Boolean value of
                  • true if operating system is OS/400, i5/OS, or IBM i.
                  • false if operating system is not OS/400, i5/OS, or IBM i

                    isWindowsOSType

                    public static boolean isWindowsOSType(java.lang.String os)
                    Determines if the operating system is a type of Windows operating system.

                    Returns:
                    A Boolean value of
                    • true if operating system is a type of Windows
                    • false if operating system is not a type of Windows

                      isLinuxOSType

                      public static boolean isLinuxOSType(java.lang.String os)
                      Determines if the operating system is a type of Linux operating system.

                      Returns:
                      A Boolean value of
                      • true if operating system is a type of Linux
                      • false if operating system is not a type of Linux

                        isAixOSType

                        public static boolean isAixOSType(java.lang.String os)
                        Determines if the operating system is a type of AIX operating system.

                        Returns:
                        A Boolean value of
                        • true if operating system is a type of AIX
                        • false if operating system is not a type of AIX

                          isOS400OSType

                          public static boolean isOS400OSType(java.lang.String os)
                          Determines if the operating system is a type of OS/400 or iSeries operating system.

                          Returns:
                          A Boolean value of
                          • true if operating system is a type of OS/400, i5/OS, or IBM i
                          • false if operating system is not a type of OS/400, i5/OS, or IBM i

                            isHPUXOSType

                            public static boolean isHPUXOSType(java.lang.String os)
                            Determines if the operating system is a type of HP-UX operating system.

                            Returns:
                            A Boolean value of
                            • true if operating system is a type of HP-UX
                            • false if operating system is not a type of HP-UX

                              isSunOSType

                              public static boolean isSunOSType(java.lang.String os)
                              Determines if the operating system is a type of Solaris operating system.

                              Returns:
                              A Boolean value of
                              • true if operating system is a type of Solaris
                              • false if operating system is not a type of Solaris

                                isPowerLinuxOSType

                                public static boolean isPowerLinuxOSType(java.lang.String os)
                                Determines if the operating system is a type of Linux on POWER operating system

                                Returns:
                                A Boolean value of
                                • true if operating system is a type of Linux on POWER
                                • false if operating system is not a type of Linux on POWER

                                  getOSType

                                  public static java.lang.String getOSType(java.lang.String os)
                                  Determines the operating system type for a given operating system

                                  Returns:
                                  A String indicating the operating system type

                                  getPasswordValue

                                  public static java.lang.String getPasswordValue(java.lang.String passwordVariableName)
                                  Retrieves a password value for the currently installing application from the ibmnsi.properties file.

                                  The password is encrypted and stored as a hex string in the properties file. This will "unmask" the value and return it as a plain text string.

                                  Parameters:
                                  passwordVariableName - - a String passwordVariableName
                                  Returns:
                                  A String indicating the password value

                                  getIbmNsiPropValue

                                  public static java.lang.String getIbmNsiPropValue(java.lang.String variable)
                                  Gets a value from the ibmnsi.properties file. Uses the application ID of the product currently installing and the name of the variable, concatenated together to form the key.

                                  Parameters:
                                  variable - -the variable name to use to get the value from the properties file.
                                  Returns:
                                  A String indicating the value in the properties file

                                  getIbmNsiPropValueByKey

                                  public static java.lang.String getIbmNsiPropValueByKey(java.lang.String key)
                                  Gets a value from the ibmnsi.properties file.

                                  Parameters:
                                  key - -a string key in the ibmnsi.properties file
                                  Returns:
                                  A String indicating the value in the properties file

                                  getIbmNsiISMPPropValue

                                  public static java.lang.String getIbmNsiISMPPropValue(java.lang.String variable,
                                                                                        java.lang.String propertyKeyType)
                                  Gets a value from the ibmnsi.properties file. Uses the application ID of the product currently installing, the property key type and the name of the variable, concatenated together to form the key.

                                  Parameters:
                                  variable - - the string variable name
                                  propertyKeyType - - the string property key type. Valid key types are:
                                  • ISMP_GLOBAL_PROPERTY, ISMP_PRODUCT_PROPERTY, and ISMP_WIZARD_PROPERTY
                                  Returns:
                                  A String indicating the value in the properties file

                                  log

                                  public static boolean log(java.lang.String message)
                                  Writes a message to a log file. Writes logging information to a specified file prepended with a timestamp and "**** ". The log file name is prepended with the path to the logs directory.

                                  The log file used is determined as follow: First, if the application deployment accelerator specified a log file name, that file name is retrieved from the ibmnsi.properties file. Otherwise, it will check if the log file name has been set in setLogFileName. If not set, then a default name of productInstallingId.log is used.

                                  Parameters:
                                  message - -the string message to log
                                  Returns:
                                  A Boolean value of
                                  • true if the logging was successful
                                  • false if an exception occurred.

                                    log

                                    public static void log(java.lang.String message,
                                                           java.lang.String logFileName)
                                    Writes the message, the timestamp and separator string to the log file specified in the logFileName

                                    Parameters:
                                    message - -Full text message string to write to the log.
                                    logFileName - -Fully qualified file name to write the message to.

                                    logNewLine

                                    public static void logNewLine()
                                    Writes a blank line to the log file.

                                    The log file name is determined as follow: First, if the application deployment accelerator specified a log file name, that file name is retrieved from the ibmnsi.properties. Otherwise, it will check if the log file name has been set in DeploymentHelper. If this was not set, then a default name of productInstallingId.log is used.


                                    logStatus

                                    public static void logStatus(boolean isInstallSuccessful)
                                    Writes a success or failure message to a log file prepended with a timestamp and "****INSTALLATION STATUS = ". This String is hardcoded to facilitate searching.

                                    The log file used is determined as follow: First, if the application deployment accelerator specified a log file name, that file name is retrieved from the ibmnsi.properties. Otherwise, it will check if the log file name has been set in setLogFileName file. If not set, then a default name of productInstallingId.log is used.

                                    Parameters:
                                    isInstallSuccessful - - if true, "SUCCESS" will be appended to the installation status string, if false, "FAILURE" will be appended.

                                    logAppendFile

                                    public static OperationStatus logAppendFile(java.lang.String fileToAppendPath)
                                    This method provides a supported mechanism for adding the contents of a file to the log. For example, the user program code can create a temporary file and invoke the installation program so that the output goes into the temporary file. After the installation program is finished, the user program can use this method to add the contents of the temporary file to the log.

                                    Note: The log file used is determined as follow: First, if the application deployment accelerator specified a log file name, that file name is retrieved from the ibmnsi.properties file. Otherwise, it will check if the log file name has been set in setLogFileName. If not set, then a default name of productInstallingId.log is used.

                                    Parameters:
                                    fileToAppendPath - the fully qualified path of the file to append to the log
                                    Returns:
                                    OperationStatus the status of the operation. Check isOK() for success or failure.

                                    logAppendFile

                                    public static OperationStatus logAppendFile(java.lang.String[] fileNames)
                                    Appends the content of each file listed in the array to the deployment wizard log file. If any one of the files does not exist, a message is written to the log.

                                    Note: The log file used is determined as follow: First, if the application deployment accelerator specified a log file name, that file name is retrieved from the ibmnsi.properties file. Otherwise, it will check if the log file name has been set in setLogFileName. If not set, then a default name of productInstallingId.log is used.

                                    Parameters:
                                    fileNames - - Array of string. Each element is a fully qualified name of a file to append.
                                    Returns:
                                    OperationStatus the status of the operation. Check OperationStatus isOK() for success or failure.

                                    removeAlphaCharsFromString

                                    public static java.lang.String removeAlphaCharsFromString(java.lang.String inputString)
                                    Removes all characters that are not 0 -9 or '.' from the input string and returns the resulting value.

                                    Parameters:
                                    inputString - - The original input string.
                                    Returns:
                                    String with just digits or "."

                                    getTempDir

                                    public static java.lang.String getTempDir()
                                    Determines and returns the temporary directory from the operating system environment.

                                    Returns:
                                    A String indicating the temporary directory for the operating system.

                                    fileGrep

                                    public static boolean fileGrep(java.lang.String filePath,
                                                                   java.lang.String searchString,
                                                                   int startIndex)
                                    Scans a file for a string.

                                    Parameters:
                                    filePath - the full path to the file to search for the string
                                    searchString - the string to search for in the file
                                    startIndex - the offset from the beginning of the file to start the search. This might be zero, in which case the entire file text String is the "substring".
                                    Returns:
                                    a boolean value of
                                    • true if the string was found in the file
                                    • false if the string was not found, or the file does not exist

                                    fileLength

                                    public static long fileLength(java.lang.String fileName)
                                    Returns the length of the file in bytes

                                    Parameters:
                                    fileName - - Specify the file name using an absolute path.
                                    Returns:
                                    long - The length of the file is returned if it exists. If it does not exist, it returns 0.

                                    directorySearch

                                    public static java.lang.String[] directorySearch(java.lang.String directoryName,
                                                                                     java.lang.String dotFileExtensionRegExpression)
                                    Searches all of the files that end with the specified file extension under the directory specified. The extension should be prepended with a dot. For example, if the dotFileExtensionRegExpression is "*.exe", all file names ending in ".exe" are returned in the array.

                                    Note: This is not a recursive search, and will not go into directories under the directoryName

                                    Parameters:
                                    directoryName - - The directory name should contain the absolute path.
                                    dotFileExtensionRegExpression - - The file extension expression to match, should be prepended with a dot.
                                    Returns:
                                    String Array of file names that match the regular expression. A zero length array is returned if no matches are found or the directory is empty. Null is returned if the directory does not exist.
                                    See Also:
                                    javadoc for regular expression details.

                                    arraySearch

                                    public static boolean arraySearch(java.lang.String[] messageArray,
                                                                      java.lang.String searchString)
                                    Search for a string in the array. If search string is an exact match to any one entry in the array, then true is returned.

                                    Parameters:
                                    messageArray - - Array of strings to search.
                                    searchString - - Search string.
                                    Returns:
                                    - A Boolean value of
                                    • true if the search string is found in the array.
                                    • false if the array is null or the search string is not in the array.

                                      isSameDirectoryName

                                      public static boolean isSameDirectoryName(java.lang.String location1,
                                                                                java.lang.String location2)
                                      Compares two directories to see if they are the same.

                                      Note: If short names are passed in for Windows, the path must exist.

                                      Parameters:
                                      location1 - the path to the first location to compare
                                      location2 - the path to the second location to compare
                                      Returns:
                                      A Boolean value of
                                      • true true if the path to directories are equal.
                                      • false otherwise.

                                      trimDoubleQuotes

                                      public static java.lang.String trimDoubleQuotes(java.lang.String inputString)
                                      Removes quotation marks from a string. It is particularly useful for values retrieved from a response file that have quotation marks.

                                      Parameters:
                                      inputString - - the string to remove quotation marks
                                      Returns:
                                      A String without quotation marks.

                                      getResourceString

                                      public static java.lang.String getResourceString(java.lang.String resourceBundle,
                                                                                       java.lang.String key,
                                                                                       java.lang.String... substitutions)
                                      Retrieves a translated message for the given key and substitution parameters in the given resource bundle.

                                      Note: The resource bundle name is a fully qualified package name without the file extension. For example, com.ibm.jsdt.main.MainManagerNLS

                                      The template string in the NLS file should have the form:

                                      {"ItemsFoundAndReturned", "{0} items found, {1} items returned"}

                                      where substitutions[] is passed as substitutions[0]=10 substitutions[1]=7

                                      This would return the string: "10 items found, 7 items returned"

                                      Parameters:
                                      resourceBundle - fully qualified package name without file extension
                                      key - the key to look for
                                      substitutions - the replacement values in order. Can be null.
                                      Returns:
                                      A String obtained from the resource bundle

                                      getPasswordValueByKey

                                      public static java.lang.String getPasswordValueByKey(java.lang.String key)
                                      Retrieves a password value from the ibmnsi.properties file.

                                      By specifying a fully qualified key, a password for applications other than the one currently installing can be obtained. The key can be in the form "taskId.appId.keyword".

                                      Any password variable key that appears in the ibmnsi.properties file can be used.

                                      The password is encrypted and stored as a hex string in the properties file. This will "unmask" the value and return it as a plain text string.

                                      Parameters:
                                      key - -the key in the ibmnsi.properties file
                                      Returns:
                                      A String indicating the password value

                                      getTiedVariableValue

                                      public static java.util.List<java.lang.String> getTiedVariableValue(java.lang.String variableKeyword)
                                      Returns a List of tied, host attribute values that correspond to the variable keyword for the currently installing application.

                                      There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.

                                      The order of the values in the list corresponds to the natural ordering of the fully-qualified hostnames for the particular tied task. The list of ordered, fully-qualified hostnames is available through the property <tiedTaskID>.qualified.hostnames.

                                      Parameters:
                                      variableKeyword - - the variable keyword.
                                      Returns:
                                      A List of tied host attribute values

                                      getQualifiedTiedVariableValue

                                      public static java.util.List<java.lang.String> getQualifiedTiedVariableValue(java.lang.String task,
                                                                                                                   java.lang.String applicationId,
                                                                                                                   java.lang.String variableKeyword)
                                      Returns a List of tied, host attribute values that correspond to the specified task, application ID and variable keyword.

                                      There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.

                                      The order of the values in the list corresponds to the natural ordering of the fully-qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <tied task ID>.qualified.hostnames.

                                      Parameters:
                                      task - -this is the task that contains the application whose variable has been tied. It is not the task that supplies the attribute to which the variable has been tied.
                                      applicationId - -the application which contains the variable whose value is tied.
                                      variableKeyword - -the variable keyword.
                                      Returns:
                                      A List of values.

                                      getTiedVariableValueForKey

                                      public static java.util.List<java.lang.String> getTiedVariableValueForKey(java.lang.String key)
                                      Returns a List of tied, host attribute values that correspond to the specified key.

                                      There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.

                                      If the key is not task qualified, the current task is assumed.

                                      The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <tied task ID>.qualified.hostnames.

                                      Parameters:
                                      key - -composed of: <task (if any)>.<applicationId>.<variableKeyword>.
                                      Returns:
                                      A List of values.

                                      getTiedPasswordValue

                                      public static java.util.List<java.lang.String> getTiedPasswordValue(java.lang.String variableKeyword)
                                      Returns a List of tied, host password values that correspond to the variable keyword for the currently installing application.

                                      There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.

                                      The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <tied task id>.qualified.hostnames.

                                      Parameters:
                                      variableKeyword - - the variable keyword
                                      Returns:
                                      A List of password values.

                                      getQualifiedTiedPasswordValue

                                      public static java.util.List<java.lang.String> getQualifiedTiedPasswordValue(java.lang.String task,
                                                                                                                   java.lang.String applicationId,
                                                                                                                   java.lang.String variableKeyword)
                                      Returns a List of tied, password attribute values that correspond to the specified task, application ID and variable keyword.

                                      There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.

                                      The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <tied task ID>.qualified.hostnames.

                                      Parameters:
                                      task - - this is the task that contains the application whose variable has been tied. It is not the task that supplies attributes to which the variable has been tied.
                                      applicationId - - the application which contains the variable whose value is tied.
                                      variableKeyword - - the variable keyword.
                                      Returns:
                                      A List of password values.

                                      getTiedPasswordValueForKey

                                      public static java.util.List<java.lang.String> getTiedPasswordValueForKey(java.lang.String key)
                                      Returns a List of tied, host password values that correspond to the specified key.

                                      There is one value for each target computer selected for the task supplying the attribute to which the variable has been tied.

                                      If the key is not task qualified, the current task is assumed.

                                      The order of the values in the list corresponds to the natural ordering of the fully qualified hostnames for the particular tied task. The list of ordered, fully qualified hostnames is available through the property <tied task ID>.qualified.hostnames.

                                      Parameters:
                                      key - -composed as following (using dots): <task (if any)>.<applicationId>.<variableKeyword>
                                      Returns:
                                      A List of password values.

                                      isVersionSupported

                                      public static boolean isVersionSupported(java.lang.String version,
                                                                               java.lang.String lowestSupportedVersion,
                                                                               java.lang.String highestSupportedVersion)
                                      Determines if the version specified falls within the boundary of the lowest supported version and highest supported version. The version strings should be comprised of only dots and numbers. Other characters will be ignored.

                                      Parameters:
                                      version - - version of a product to verify if supported
                                      lowestSupportedVersion - - the lowest supported version of a product
                                      highestSupportedVersion - - the highest supported version of product
                                      Returns:
                                      A Boolean value of
                                      • true if the version of product being checked is the same as, or between the provided lower and upper supported limits.
                                      • false otherwise.

                                        valueExists

                                        public static boolean valueExists(java.lang.String stringToSearch,
                                                                          java.lang.String[] values)
                                        Determines if any of the given values exist in a given string.

                                        Parameters:
                                        stringToSearch - - the string to be searched for a particular value
                                        values - - an array of string values
                                        Returns:
                                        A Boolean value of
                                        • true> if any of the values are found in the string.
                                        • false otherwise.

                                          fileSearchAndReturnLinesWithSearch

                                          public static java.lang.String[] fileSearchAndReturnLinesWithSearch(java.lang.String filename,
                                                                                                              java.lang.String find,
                                                                                                              int startSearchPosition)
                                          Searches each line of a file to find a particular string. If the string is found, then it appends to a buffer the entire line with that string.

                                          Parameters:
                                          filename - - The file name that contains the string.
                                          find - - The string to find.
                                          startSearchPosition - - The position of the file to start searching from.
                                          Returns:
                                          An array of all of the lines with the string

                                          getQualifiedHostName

                                          public static java.lang.String getQualifiedHostName()
                                          Retrieves the fully qualified local host name.

                                          Returns:
                                          A String indicating the qualified host name.

                                          getSetupFileRemovalSetting

                                          public static boolean getSetupFileRemovalSetting()
                                          Gets the setup file removal setting indicating whether or not the setup files will be removed at the completion of the installation. The default value is true.

                                          Returns:
                                          A boolean value of
                                          • true if setup files will be removed.
                                          • false if setup files will not be removed.

                                          setResponseFileProperty

                                          public static boolean setResponseFileProperty(java.lang.String propertiesFilePath,
                                                                                        java.lang.String key,
                                                                                        java.lang.String value)
                                          Sets a property value into a Java properties formatted response file.

                                          Parameters:
                                          propertiesFilePath - -In order to obtain the correct response file path and name, one of the following methods should be used: getPreDeploymentCheckerResponseFilePath, getEntryResponseFilePath, getMainResponseFilePath, getExitResponseFilePath, getResponseFilePath.
                                          key - - key for a variable in the property file.
                                          value - - value of the key.
                                          Returns:
                                          A boolean value of
                                          • true if the set was successful
                                          • false otherwise.

                                            getResponseFileProperty

                                            public static java.lang.String getResponseFileProperty(java.lang.String propertiesFilePath,
                                                                                                   java.lang.String key)
                                            Gets a property value from a Java properties formatted response file.

                                            Parameters:
                                            propertiesFilePath - -In order to obtain the correct response file path and name, one of the following methods should be used: getPreDeploymentCheckerResponseFilePath, getEntryResponseFilePath, getMainResponseFilePath, getExitResponseFilePath, getResponseFilePath.
                                            key - - key for a variable in the property file.
                                            Returns:
                                            A String value.

                                            getResponseFileProperties

                                            public static java.util.Properties getResponseFileProperties(java.lang.String propertiesFilePath)
                                            Gets a property object populated by a Java properties formatted response file.

                                            Parameters:
                                            propertiesFilePath - -In order to obtain the correct response file path and name, one of the following methods should be used: getPreDeploymentCheckerResponseFilePath, getEntryResponseFilePath, getMainResponseFilePath, getExitResponseFilePath, getResponseFilePath.
                                            Returns:
                                            Properties

                                            getResponseFileValue

                                            public static java.lang.String getResponseFileValue(java.lang.String responseFileName,
                                                                                                java.lang.String key)
                                            Scans a response file for a key and returns the string value found. This is a generic function that retrieves the value (right side) in a "key = value" pair in a given text based file.

                                            Parameters:
                                            responseFileName - - file with key=value properties.
                                            key - - key to find the value
                                            Returns:
                                            The String value found at the key

                                            setResponseFileValue

                                            public static boolean setResponseFileValue(java.lang.String responseFileName,
                                                                                       java.lang.String key,
                                                                                       java.lang.String keyValue,
                                                                                       boolean createKeyIfDoesNotExist)
                                            Scans a response file for a key and sets the corresponding value. This function will set or replace a value in a response file. The value (right side) must be part of a "key = value" pair. It requires three String arguments: the name of the file prepended with the absolute path, the key (leftside of key = value), and the new value. The "key = value" pair must be on the same line in the text-based response file. The line must start with the var/key (there should be no preceding asterisks or blank spaces and so on). Typically, you can prepend the response file name with the return value from getLogsDir() which is an absolute path to the logs directory.

                                            Parameters:
                                            responseFileName - - file with key=value properties
                                            key - - key to find paired value from response file
                                            keyValue - - new value to set for the key
                                            createKeyIfDoesNotExist - - set this to true if a key should be created if one does not exist.
                                            Returns:
                                            A boolean value of
                                            • true if operation was successful
                                            • false if operation failed

                                            unPackJar

                                            public static boolean unPackJar(java.lang.String absolutePathName,
                                                                            java.lang.String destinationDirPath)
                                            Unpacks a JAR file.

                                            Parameters:
                                            absolutePathName - -The absolute path to the JAR file including the name of the JAR file.
                                            destinationDirPath - -The absolute destination path where the jar file will be upacked to.
                                            Returns:
                                            A boolean value of
                                            • true if the JAR file was successfully unpacked.
                                            • false otherwise.

                                              isPortRegistered

                                              public static boolean isPortRegistered(int port)
                                              Checks the operating system services file to see if the port is already registered.

                                              Parameters:
                                              port - the port to check
                                              Returns:
                                              A boolean value of
                                              • true if the port is already registered.
                                              • false otherwise.

                                                isIpv6Address

                                                public static boolean isIpv6Address(java.lang.String computerName)
                                                Indicates whether or not the specified computer name is an IPv6 address.

                                                For example, "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210" would return true. The name "test.ibm.com" would return false.

                                                Parameters:
                                                computerName - - a computer name.
                                                Returns:
                                                A boolean indicating whether or not the computer name is in IPv6 format.

                                                getDeploymentWizardSpecificationVersion

                                                public static java.lang.String getDeploymentWizardSpecificationVersion()
                                                Retrieves the specification-version of the deployment wizard.

                                                It will return null for specification-versions prior to 2.1.1.0

                                                Returns:
                                                A String indicating the specification version

                                                getBackLevelJsdtMessage

                                                protected static java.lang.String getBackLevelJsdtMessage(java.lang.String methodName)
                                                Obtains a back-level version message when an unavailable new API is called.

                                                Parameters:
                                                methodName - - a method name.
                                                Returns:
                                                A String

                                                getBackLevelDeployerMessage

                                                protected static java.lang.String getBackLevelDeployerMessage(java.lang.String methodName,
                                                                                                              java.lang.String sinceVersion)
                                                Obtains a back-level version message when an unavailable new API is called that is dependent on the version of the deployment wizard.

                                                Parameters:
                                                methodName - - a method name.
                                                Returns:
                                                String the earliest compatible version the deployer.

                                                getLogger

                                                public static java.util.logging.Logger getLogger()
                                                Return a standard java.util.logging.Logger that can be used to log trace information to the support framework trace.

                                                Returns:
                                                Logger support framework logger

                                                trace

                                                public static void trace(java.lang.String text)
                                                Deprecated. 

                                                Logs the text to the support framework trace log (IRU_SupportTrace.log by default). This text will only be logged when the support framework trace is enabled and the log file has not exceeded its maximum size.

                                                Parameters:
                                                text - - The text to be logged
                                                See Also:
                                                getLogger

                                                trace

                                                public static void trace(java.lang.Object object)
                                                Deprecated. 

                                                Trace method that can log something other than a String object. Uses the IRU_SupportTrace.log file by default. The object will only be logged when the support framework trace is enabled and the log file has not exceeded its maximum size.

                                                Parameters:
                                                object - - a oject method that need to be traced.
                                                See Also:
                                                getLogger

                                                trace

                                                public static void trace(java.lang.Object[] objects)
                                                Deprecated. 

                                                Trace method that can log an array of objects. Uses the IRU_SupportTrace.log file by default. The object will only be logged when the support framework trace is enabled and the log file has not exceeded its maximum size.

                                                Parameters:
                                                objects - - the object methods that need to be traced.
                                                See Also:
                                                getLogger

                                                setMainResources

                                                public void setMainResources(java.lang.String myResources)
                                                Set the name of the main ResourceBundle.

                                                Note that this is a fully qualified package name without the file extension.

                                                Overrides:
                                                setMainResources in class com.ibm.jsdt.common.Base
                                                Parameters:
                                                myResources - the ResourceBundle to use

                                                getPreDeploymentCheckerResponseFilePath

                                                public static java.lang.String getPreDeploymentCheckerResponseFilePath()
                                                Retrieves the name of the response file specified for the pre-deploymentChecker program prepended with the logs directory path.

                                                If no response file was specified for this program, null will be returned.

                                                If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                Returns:
                                                A String indicating the response file path for the pre-deployment checker program

                                                getPreDeploymentCheckerResponseFilePath

                                                public static java.lang.String getPreDeploymentCheckerResponseFilePath(java.lang.String originalResponseFileName)
                                                Retrieves the name of the response file specified for the PreDeploymentChecker program prepended with the logs directory path.

                                                If no response file was specified for this program, null will be returned.

                                                If the Deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.

                                                Parameters:
                                                the - name of the original (source) response file.
                                                Returns:
                                                String -the response file path for the pre-deployment checker program

                                                getEntryResponseFilePath

                                                public static java.lang.String getEntryResponseFilePath()
                                                Retrieves the name of the response file specified for the entry program prepended with the directory path containing the logs file.

                                                If no response file was specified for this program, null will be returned.

                                                If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                Returns:
                                                A String indicating the path to the response file for the entry program.

                                                getEntryResponseFilePath

                                                public static java.lang.String getEntryResponseFilePath(java.lang.String originalResponseFileName)
                                                Retrieves the name of the response file specified for the Entry program prepended with the logs directory path.

                                                If no response file was specified for this program, null will be returned.

                                                If the Deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.

                                                Parameters:
                                                the - name of the original (source) response file.
                                                Returns:
                                                String -the path to the entry program's response file

                                                getMainResponseFilePath

                                                public static java.lang.String getMainResponseFilePath()
                                                Retrieves the name of the response file specified for the main program prepended with the directory path containing the log files.

                                                If no response file was specified for this program, null will be returned.

                                                If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                Returns:
                                                A String indicating the path to the response file for the main program

                                                getMainResponseFilePath

                                                public static java.lang.String getMainResponseFilePath(java.lang.String originalResponseFilePath)
                                                Retrieves the name of the response file specified for the Main program prepended with the logs directory.

                                                If no response file was specified for this program, null will be returned.

                                                If the Deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.

                                                Parameters:
                                                the - name of the original (source) response file.
                                                Returns:
                                                String -the path to the main program's response file

                                                getExitResponseFilePath

                                                public static java.lang.String getExitResponseFilePath()
                                                Retrieves the name of the response file specified for the exit program prepended with the directory path containing the log files.

                                                If no response file was specified for this program, null will be returned.

                                                If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                Returns:
                                                A String indicating the path to the response file for the exit program

                                                getExitResponseFilePath

                                                public static java.lang.String getExitResponseFilePath(java.lang.String originalResponseFilePath)
                                                Retrieves the name of the response file specified for the Exit program prepended with the logs directory.

                                                If no response file was specified for this program, null will be returned.

                                                If the Deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.

                                                Parameters:
                                                the - name of the original (source) response file.
                                                Returns:
                                                String -the path to the exit program's response file.

                                                getResponseFilePath

                                                public static java.lang.String getResponseFilePath(int stage)
                                                Retrieves the name of the response file specified for the program prepended with the logs directory.

                                                If no response file was specified for this program, null will be returned.

                                                If the deployment wizard has a specification version earlier than 2.1.1.0, then this method will return null .

                                                Parameters:
                                                stage - - the stage or program type
                                                Returns:
                                                A String indicating the response file path

                                                getResponseFilePath

                                                public static java.lang.String getResponseFilePath(int stage,
                                                                                                   java.lang.String sourceName)
                                                Gets the qualifed, updated response file path for the specified original response file source name.

                                                If more than one response file was specified for the user program, the original name of the response file is required to calculate the updated response file path.

                                                Parameters:
                                                stage -
                                                sourceName -
                                                Returns:
                                                String

                                                runAs

                                                protected static int runAs(java.lang.String userId,
                                                                           java.lang.String password,
                                                                           java.lang.String command)
                                                Runs the command on the local computer as the specified user.

                                                This will not run on i5 systems.

                                                Type Parameters:
                                                code - String userId
                                                code - String password
                                                code - String command

                                                runAs

                                                protected static int runAs(java.lang.String userId,
                                                                           java.lang.String password,
                                                                           java.lang.String command,
                                                                           boolean shouldLogOutput)
                                                Runs the command on the local computer as the specified user.

                                                This will not run on i5 systems.

                                                Type Parameters:
                                                code - String userId
                                                code - String password
                                                code - String command
                                                Returns:
                                                int the return code of the command.