com.ibm.di.UpdateInstaller
Class FixUtils

java.lang.Object
  extended by com.ibm.di.UpdateInstaller.FixUtils

public class FixUtils
extends Object

A variety of utilities and constants available for use throughout the update installer.


Field Summary
static String AIX
          String representing the AIX operating system
static String AIX64
          String representing the AIX 64-bit operating system
static String AMC
          String representing the AMC TDI component
static String BASE
          String representing the BASE TDI component
static String CE
          String representing the CE TDI component
static String CE_UPDATE
          String representing the CE Update TDI component
static String EDITION
          String representing the EDITION section of the .registry file
static String EWP
          String representing the BASE TDI component
static String EXAMPLES
          String representing the Examples TDI component
static String FIXES
          String representing the FIXES section of the .registry file
static String FIXPACK_INDICATOR
          String representing a fixpack.
static String FULL
          String representing the full license version of TDI
static String GENERAL
          String representing the General Purpose version of TDI
static String HPIA64
          String representing the HP-UX 64 bit Itanium operating system
static String HPUX
          String representing an HP-UX operating system
static String I5OS
          String representing the I5OS operating system
static String IDENTITY
          String representing the Identity version of TDI
static String IEHS
          String representing the IEHS TDI component
static String JDOCS
          String representing the JavaDocs TDI component
static String LEVEL
          String representing the LEVEL section of the .registry file
static String LICENSE
          String representing the LICENSE section of the .registry file
static String LINUX
          String representing a Linux operating system
static String LINUX_AMD64
          String representing the Linux AMD64 operating system
static String LINUX_PPC
          String representing the Linux PPC operating system
static String NAME
          String representing the NAME section of the .manifest file
static String NONE
          String representing the value "None"
static String OBJECT_CODE
          The copyright notice for binary java code required by legal.
static String OPTERON
          String representing the Solaris Opteron operating system
static String PLUGINS
          String representing the PLUGINS TDI component
static String PREREQ
          String representing the PREREQ section of the .manifest file
static String SERVER
          String representing the SERVER TDI component
static String SOLARIS
          String representing a Solaris operating system
static String TRIAL
          String representing the trial license version of TDI
static String UNKNOWN
          String representing an unknown operating system
static String WINDOWS
          String representing a Windows operating system
static String WINDOWS64
          String representing the Windows AMD64
static String ZLINUX
          String representing the zLinux operating system
 
Method Summary
static int createAndExecUnixScript(String[] cmds)
          Creates a temporary script named ./tempScript.sh from the commands in the passed in array and then executes that script.
static int executeCommand(String[] commands)
          Executes an operating system command.
static String[] getComponents()
          Gets the list of TDI components
static String getOS()
          Determines the current operating system.
static String[] readFile(InputStream infile)
          Given an InputStream, will read a file into an array.
static String[] readFile(String filename)
          Given a filename, will read that file into an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OBJECT_CODE

public static final String OBJECT_CODE
The copyright notice for binary java code required by legal.

See Also:
Constant Field Values

BASE

public static final String BASE
String representing the BASE TDI component

See Also:
Constant Field Values

SERVER

public static final String SERVER
String representing the SERVER TDI component

See Also:
Constant Field Values

CE

public static final String CE
String representing the CE TDI component

See Also:
Constant Field Values

CE_UPDATE

public static final String CE_UPDATE
String representing the CE Update TDI component

See Also:
Constant Field Values

JDOCS

public static final String JDOCS
String representing the JavaDocs TDI component

See Also:
Constant Field Values

EXAMPLES

public static final String EXAMPLES
String representing the Examples TDI component

See Also:
Constant Field Values

IEHS

public static final String IEHS
String representing the IEHS TDI component

See Also:
Constant Field Values

EWP

public static final String EWP
String representing the BASE TDI component

See Also:
Constant Field Values

AMC

public static final String AMC
String representing the AMC TDI component

See Also:
Constant Field Values

PLUGINS

public static final String PLUGINS
String representing the PLUGINS TDI component

See Also:
Constant Field Values

FIXES

public static final String FIXES
String representing the FIXES section of the .registry file

See Also:
Constant Field Values

LEVEL

public static final String LEVEL
String representing the LEVEL section of the .registry file

See Also:
Constant Field Values

PREREQ

public static final String PREREQ
String representing the PREREQ section of the .manifest file

See Also:
Constant Field Values

NAME

public static final String NAME
String representing the NAME section of the .manifest file

See Also:
Constant Field Values

EDITION

public static final String EDITION
String representing the EDITION section of the .registry file

See Also:
Constant Field Values

LICENSE

public static final String LICENSE
String representing the LICENSE section of the .registry file

See Also:
Constant Field Values

TRIAL

public static final String TRIAL
String representing the trial license version of TDI


FULL

public static final String FULL
String representing the full license version of TDI


GENERAL

public static final String GENERAL
String representing the General Purpose version of TDI


IDENTITY

public static final String IDENTITY
String representing the Identity version of TDI


NONE

public static final String NONE
String representing the value "None"


WINDOWS

public static final String WINDOWS
String representing a Windows operating system

See Also:
Constant Field Values

WINDOWS64

public static final String WINDOWS64
String representing the Windows AMD64

See Also:
Constant Field Values

I5OS

public static final String I5OS
String representing the I5OS operating system

See Also:
Constant Field Values

ZLINUX

public static final String ZLINUX
String representing the zLinux operating system

See Also:
Constant Field Values

AIX

public static final String AIX
String representing the AIX operating system

See Also:
Constant Field Values

AIX64

public static final String AIX64
String representing the AIX 64-bit operating system

See Also:
Constant Field Values

SOLARIS

public static final String SOLARIS
String representing a Solaris operating system

See Also:
Constant Field Values

OPTERON

public static final String OPTERON
String representing the Solaris Opteron operating system

See Also:
Constant Field Values

LINUX_PPC

public static final String LINUX_PPC
String representing the Linux PPC operating system

See Also:
Constant Field Values

LINUX_AMD64

public static final String LINUX_AMD64
String representing the Linux AMD64 operating system

See Also:
Constant Field Values

LINUX

public static final String LINUX
String representing a Linux operating system

See Also:
Constant Field Values

HPIA64

public static final String HPIA64
String representing the HP-UX 64 bit Itanium operating system

See Also:
Constant Field Values

HPUX

public static final String HPUX
String representing an HP-UX operating system

See Also:
Constant Field Values

UNKNOWN

public static final String UNKNOWN
String representing an unknown operating system

See Also:
Constant Field Values

FIXPACK_INDICATOR

public static final String FIXPACK_INDICATOR
String representing a fixpack. If a fix name starts with this, it is a fixpack.

See Also:
Constant Field Values
Method Detail

getComponents

public static final String[] getComponents()
Gets the list of TDI components

Returns:
An array representing TDI components

readFile

public static String[] readFile(InputStream infile)
Given an InputStream, will read a file into an array.

Parameters:
infile - The InputStream to be read
Returns:
An array of the lines in the file, or null if the file is empty or an error occurred

readFile

public static String[] readFile(String filename)
Given a filename, will read that file into an array.

Parameters:
filename - The name of the file to be read
Returns:
An array of the lines in the file, or null if the file is empty or an error occurred

executeCommand

public static int executeCommand(String[] commands)
Executes an operating system command.

Parameters:
commands - An array representing a command to run and its arguments
Returns:
0 if the command completed without an error, nonzero otherwise

getOS

public static String getOS()
Determines the current operating system.

Returns:
A string from the list above representing the current operating system

createAndExecUnixScript

public static int createAndExecUnixScript(String[] cmds)
Creates a temporary script named ./tempScript.sh from the commands in the passed in array and then executes that script. The temporary script is deleted after it is executed. This method is only intended for use on a UNIX operating system. The purpose of this function is to be able to executed that you normally can't by simply calling a regular exec, or if you want to group several shell cmds together in one call.

Parameters:
cmds - Commands to write to the temporary script file
Returns:
0 if no error was detected, nonzero otherwise