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:
  • Field Details

    • TIMEOUT_RETURN_CODE

      public static final int TIMEOUT_RETURN_CODE
      See Also:
    • commandLine

      protected final String commandLine
    • output

      protected final List<String> output
    • execTime

      protected final long execTime
    • success

      protected boolean success
    • error

      protected final CommandException error
    • returnCode

      protected int returnCode
  • Constructor Details

    • ExecResult

      public ExecResult(String commandLine, List<String> output, long execTime, int returnCode)
    • ExecResult

      public ExecResult(String commandLine, Exception error)
    • ExecResult

      public ExecResult(String timeoutError)
      Creates a timeout error result.
      Since:
      2021.41
  • Method Details

    • getOutput

      public List<String> getOutput()
    • getExecTime

      public long getExecTime()
    • isSuccessful

      public boolean isSuccessful()
    • getError

      public CommandException getError()
      Rather rely on isSuccessful() to check for the execution success. Note however that since 5.7.3, the getError() 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()