Class ExecResult
java.lang.Object
org.nuxeo.ecm.platform.commandline.executor.api.ExecResult
- All Implemented Interfaces:
Serializable
Wraps result of the command-line execution:
- executed command line,
- output buffer,
- return code,
- java Exception.
- Author:
- tiry
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected final CommandExceptionprotected final longprotected intprotected booleanstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionExecResult(String timeoutError) Creates a timeout error result.ExecResult(String commandLine, Exception error) ExecResult(String commandLine, List<String> output, long execTime, int returnCode) -
Method Summary
Modifier and TypeMethodDescriptiongetError()Rather rely onisSuccessful()to check for the execution success.longintbooleanboolean
-
Field Details
-
TIMEOUT_RETURN_CODE
public static final int TIMEOUT_RETURN_CODE- See Also:
-
commandLine
-
output
-
execTime
protected final long execTime -
success
protected boolean success -
error
-
returnCode
protected int returnCode
-
-
Constructor Details
-
ExecResult
-
ExecResult
-
ExecResult
Creates a timeout error result.- Since:
- 2021.41
-
-
Method Details
-
getOutput
-
getExecTime
public long getExecTime() -
isSuccessful
public boolean isSuccessful() -
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
- Returns:
- the executed command line
- Since:
- 5.5
-
isCommandInTimeout
public boolean isCommandInTimeout()
-