runProcess
public static int runProcess(java.io.File workingDir,
java.lang.String cmd,
java.lang.String stdin,
Text stdout,
Text stderr,
boolean wait)
throws java.io.IOException
Runs the given process and returns the result code. Feeds the given string
to the stdin of the run process. If stdout or stderr is non-null, they are
filled with the stdout or stderr of the run process, respectively.
If wait is set to true, the process is run in synchronous mode where we
wait until it is finished. Otherwise, this function call returns
immediately and leaves the process running in the background. In the later
case, stdout, stderr and the return value are not valid.
- Parameters:
workingDir
- - The working directory to run the script. Set null for
default.cmd
- - The command line to run including all parametersstdin
- - The string to feed to the stdin of the run process.stdout
- - If non-null, the stdout of the process is fed here.stderr
- - If non-null, the stderr of the process is fed here.wait
- - Set to true to wait until the process exits.
- Returns:
- Throws:
java.io.IOException