executeCommand
public int executeCommand(java.lang.String command,
java.lang.String[] envp,
java.io.File dir,
boolean printOutput)
throws java.io.IOException,
java.lang.InterruptedException
This method executes a system command based on the specified parameter.
The method is designed such that it returns ONLY after the command has
completed execution. A return value of 0 indicates normal termination,
while anything else will signify abnormal termination.
- Parameters:
command
- The specified system commandenvp
- Array of strings, each element of which has environment
variable settings in the format name=value, or
null if the subprocess should inherit the environment
of the current process.dir
- The working directory of the subprocess, or null if
the subprocess should inherit the working directory of the
current process.printOutput
- Prints the output of the execution of the command
- Returns:
- the exit value of the process. By convention, 0 indicates normal
termination
- Throws:
java.io.IOException
- If an I/O error occurs
java.lang.InterruptedException
- if the current thread is interrupted by another thread while
it is waiting, then the wait is ended and an
InterruptedException
is thrown.