|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibis.util.RunProcess
Utility to run a process and read its output in a separate thread.
Afterwards, the user can obtain the output or error output.
To run a command, the sequence is:
RunProcess p = new RunProcess("command ..."); byte[] o = p.getStdout(); byte[] e = p.getStderr(); int status = p.getExitStatus();
Constructor Summary | |
RunProcess(java.lang.String command)
Runs the command as specified. |
|
RunProcess(java.lang.String[] command,
java.lang.String[] env)
Runs the command as specified. |
|
RunProcess(java.lang.String[] command,
java.lang.String[] env,
java.io.File dir)
Runs the command as specified. |
Method Summary | |
int |
getExitStatus()
Returns the exit status of the process. |
byte[] |
getStderr()
Returns the error output buffer of the process. |
byte[] |
getStdout()
Returns the output buffer of the process. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RunProcess(java.lang.String command)
command
- the specified command.public RunProcess(java.lang.String[] command, java.lang.String[] env)
command
- the specified command and arguments.env
- the environment.public RunProcess(java.lang.String[] command, java.lang.String[] env, java.io.File dir)
command
- the specified command and arguments.env
- the environment.dir
- dir - the working directory of the command, or null
for the working directory of this process.Method Detail |
public byte[] getStdout()
public byte[] getStderr()
public int getExitStatus()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |