Class ExecResult
- java.lang.Object
-
- org.nuxeo.ecm.platform.commandline.executor.api.ExecResult
-
- All Implemented Interfaces:
Serializable
public class ExecResult extends Object implements Serializable
Wraps result of the command-line execution:- executed command line,
- output buffer,
- return code,
- java Exception.
- Author:
- tiry
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcommandLineprotected CommandExceptionerrorprotected longexecTimeprotected List<String>outputprotected intreturnCodeprotected booleansuccessstatic intTIMEOUT_RETURN_CODE
-
Constructor Summary
Constructors Constructor Description ExecResult(String timeoutError)Creates a timeout error result.ExecResult(String commandLine, Exception error)ExecResult(String commandLine, List<String> output, long execTime, int returnCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCommandLine()CommandExceptiongetError()Rather rely onisSuccessful()to check for the execution success.longgetExecTime()List<String>getOutput()intgetReturnCode()booleanisCommandInTimeout()booleanisSuccessful()
-
-
-
Field Detail
-
TIMEOUT_RETURN_CODE
public static final int TIMEOUT_RETURN_CODE
- See Also:
- Constant Field Values
-
commandLine
protected final String commandLine
-
execTime
protected final long execTime
-
success
protected boolean success
-
error
protected final CommandException error
-
returnCode
protected int returnCode
-
-
Method Detail
-
getExecTime
public long getExecTime()
-
isSuccessful
public boolean isSuccessful()
-
getError
public CommandException getError()
Rather rely onisSuccessful()to check for the execution success. Note however that since 5.7.3, thegetError()method cannot return null even if the execution failed (it was not the case before).- Returns:
- CommandException attached to the result, optionally wrapping the root cause.
-
getReturnCode
public int getReturnCode()
-
getCommandLine
public String getCommandLine()
- Returns:
- the executed command line
- Since:
- 5.5
-
isCommandInTimeout
public boolean isCommandInTimeout()
-
-