org.schmant.support.io
Class ProcessResult

java.lang.Object
  extended by org.schmant.support.io.ProcessResult

public class ProcessResult
extends Object

An object of this class represents the result from a running process. It contains the process' exit code and optionally its output to stdout and stderr if the used ProcessOutputStrategy supports that.

Since:
0.5
Author:
Karl Gustafsson

Constructor Summary
ProcessResult(int exitCode, String stdout, String stderr)
           
 
Method Summary
 int getExitCode()
          Get the exit code from the process.
 String getStderrOutput()
          Get the process' output to stderr, if that was collected by the ProcessOutputStrategy used.
 String getStdoutOutput()
          Get the process' output to stdout, if that was collected by the ProcessOutputStrategy used.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessResult

public ProcessResult(int exitCode,
                     String stdout,
                     String stderr)
Method Detail

getExitCode

public int getExitCode()
Get the exit code from the process.

Returns:
The process' exit code.

getStdoutOutput

public String getStdoutOutput()
Get the process' output to stdout, if that was collected by the ProcessOutputStrategy used.

Returns:
The process' output to stdout, or null if that is not supported by the ProcessOutputStrategy.

getStderrOutput

public String getStderrOutput()
Get the process' output to stderr, if that was collected by the ProcessOutputStrategy used.

Returns:
The process' output to stderr, or null if that is not supported by the ProcessOutputStrategy.

toString

public String toString()
Overrides:
toString in class Object