public class SystemRun
extends java.lang.Object
SystemRun.ResultHandler.
public class ExtendedResultHandler extends SystemRun.ResultHandler {
public String result_or_error;
public void onProcessComplete(int exitValue) {
super.onProcessComplete(exitValue);
result_or_error = getResultString();
}
public void onProcessFailed(ExecuteException e) {
super.onProcessFailed(e);
result_or_error = getResultString();
}
}
| Modifier and Type | Class and Description |
|---|---|
static class |
SystemRun.ResultHandler
result handler to execute
CommandLine
process out/err string is reserved in output_stream_ |
| Constructor and Description |
|---|
SystemRun() |
| Modifier and Type | Method and Description |
|---|---|
static SystemRun.ResultHandler |
execCommand(org.apache.commons.exec.CommandLine cmd)
execute
CommandLine and return SystemRun.ResultHandler |
static SystemRun.ResultHandler |
execCommand(org.apache.commons.exec.CommandLine cmd,
long timeout)
execute
CommandLine and return SystemRun.ResultHandler
when execution end or timed out |
static void |
execCommand(org.apache.commons.exec.CommandLine cmd,
long timeout,
SystemRun.ResultHandler handler)
execute asynchronously.
|
static SystemRun.ResultHandler |
execCommand(java.lang.String cmd)
execute command string and return
SystemRun.ResultHandler |
static SystemRun.ResultHandler |
execCommand(java.lang.String cmd,
long timeout)
execute command string and return
SystemRun.ResultHandler
when execution end or timed out |
public static SystemRun.ResultHandler execCommand(org.apache.commons.exec.CommandLine cmd) throws java.io.IOException
CommandLine and return SystemRun.ResultHandlercmd - CommandLineSystemRun.ResultHandlerjava.io.IOExceptionpublic static SystemRun.ResultHandler execCommand(org.apache.commons.exec.CommandLine cmd, long timeout) throws java.io.IOException
CommandLine and return SystemRun.ResultHandler
when execution end or timed outcmd - CommandLinetimeout - Process execution time outjava.io.IOExceptionpublic static SystemRun.ResultHandler execCommand(java.lang.String cmd) throws java.io.IOException
SystemRun.ResultHandlercmd - Command stringSystemRun.ResultHandlerjava.io.IOExceptionpublic static SystemRun.ResultHandler execCommand(java.lang.String cmd, long timeout) throws java.io.IOException
SystemRun.ResultHandler
when execution end or timed outcmd - Command stringtimeout - Process execution time outjava.io.IOExceptionpublic static void execCommand(org.apache.commons.exec.CommandLine cmd,
long timeout,
SystemRun.ResultHandler handler)
throws java.io.IOException
DefaultExecuteResultHandler.waitFor(), may be waiting for infinitely.cmd - CommandLinetimeout - Process execution time outhandler - ResultHandlerjava.io.IOException