|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.data.common.helpers.CommandResult
See StreamChomp
.
Runtime runtime = Runtime.getRuntime();
Process proc = null;
proc = runtime.exec(command.toString());
StreamChomp stdout = new StreamChomp(proc.getInputStream(),
"stdout");
StreamChomp stderr = new StreamChomp(proc.getErrorStream(),
"stderr");
stdout.start();
stderr.start();
exitCode = proc.waitFor();
while (!stdout.isDone()) {
Thread.sleep(10);
}
while (!stderr.isDone()) {
Thread.sleep(10);
}
commandResult.setOut(stdout);
commandResult.setErr(stderr);
commandResult.setRetCode(exitCode);
Constructor Summary | |
CommandResult()
|
Method Summary | |
StreamChomp |
getErr()
Get error of command. |
StreamChomp |
getOut()
Get output of command. |
int |
getRetCode()
Get return code of command. |
void |
setErr(StreamChomp err)
Bean setter method. |
void |
setOut(StreamChomp out)
Bean setter method. |
void |
setRetCode(int retCode)
Bean setter method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandResult()
Method Detail |
public StreamChomp getOut()
public void setOut(StreamChomp out)
out
- the output to be setpublic StreamChomp getErr()
public void setErr(StreamChomp err)
err
- the error to be setpublic int getRetCode()
public void setRetCode(int retCode)
retCode
- return code
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |