public class Task
extends java.lang.Object
| Constructor and Description |
|---|
Task(java.lang.String[] cmd,
java.lang.String[] env,
java.io.File workDir,
long timeLimit,
java.lang.String[] errors)
Sets up an external process.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCmd()
Returns a printable string version of the external command.
|
java.lang.String |
getErrorMessage()
Returns the error message.
|
boolean |
getHasError()
Returns error state.
|
java.lang.String |
getOutput()
Returns a string version of the command's console output
|
java.lang.String |
getStderr()
Returns the STDERR stream as a string.
|
void |
run()
Executes the external process, returning when it is finished or when it
exceeds the time limit specified in the constructor.
|
void |
run(long timeLimit)
Executes the external process, returning when it is finished or when it
exceeds the time limit specified.
|
public Task(java.lang.String[] cmd,
java.lang.String[] env,
java.io.File workDir,
long timeLimit,
java.lang.String[] errors)
public void run()
throws java.lang.Exception
LASException - If the process fails, or if the output parser finds an error
message in the output.java.lang.Exceptionpublic void run(long timeLimit)
throws java.lang.Exception
timeLimit - Overrides the time limit specified in the constructor.LASException - If the process fails, or if there is an error message (a line
beginning with "error: ") in the output.java.lang.Exceptionpublic java.lang.String getCmd()
public java.lang.String getStderr()
public java.lang.String getOutput()
public boolean getHasError()
public java.lang.String getErrorMessage()