Class ProcessResult

java.lang.Object
org.codehaus.groovy.runtime.ProcessResult

public class ProcessResult extends Object
Captures the result of executing an external process, including the standard output, standard error, and exit code.
 def result = "ls -la".execute().waitForResult()
 assert result.ok
 println result.out
 
Since:
6.0.0
See Also:
  • Constructor Details

    • ProcessResult

      public ProcessResult(String out, String err, int exitCode)
  • Method Details

    • getOut

      public String getOut()
      Returns the standard output of the process as a String.
    • getErr

      public String getErr()
      Returns the standard error of the process as a String.
    • getExitCode

      public int getExitCode()
      Returns the exit code of the process.
    • isOk

      public boolean isOk()
      Returns true if the process exited with code 0.
    • toString

      public String toString()
      Overrides:
      toString in class Object