java.lang.Object
org.tentackle.common.ToolRunner
Runner for external tools.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ToolRunner
Creates a runner for a tool.Throws
TentackleRuntimeExceptionif tool not found or not executable.- Parameters:
tool- the tool
-
-
Method Details
-
arg
Adds arguments.- Parameters:
args- the arguments- Returns:
- this runner
-
toString
-
run
Runs the tool.Throws
TentackleRuntimeExceptionif running the tool failed.- Returns:
- this runner
-
getOutput
Gets the standard output.- Returns:
- the output lines, never null
-
getOutputAsString
Gets the standard output.- Returns:
- the output, never null
-
getErrors
Gets the standard error output.Throws
TentackleRuntimeExceptionif run method not invoked yet.- Returns:
- the error lines, never null
-
getErrorsAsString
Gets the standard error output.Throws
TentackleRuntimeExceptionif run method not invoked yet.- Returns:
- the errors, never null
-
getErrCode
public int getErrCode()Gets the error code.Throws
TentackleRuntimeExceptionif run method not invoked yet.- Returns:
- the error, 0 if ok
-
clear
public void clear()Clears arguments and results.
-