Package org.zeroturnaround.exec
Class ProcessResult
java.lang.Object
org.zeroturnaround.exec.ProcessResult
Exit value and output of a finished process.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intExit value of the finished process.private final ProcessOutputProcess output ornullif it wasn't read. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated.intbooleanbyte[]output()outputString(String charset)
-
Field Details
-
exitValue
private final int exitValueExit value of the finished process. -
output
Process output ornullif it wasn't read.
-
-
Constructor Details
-
ProcessResult
-
-
Method Details
-
getExitValue
public int getExitValue()- Returns:
- the exit value of the finished process.
-
exitValue
public int exitValue()Deprecated.usegetExitValue()- Returns:
- the exit value of the finished process.
-
hasOutput
public boolean hasOutput()- Returns:
trueif the process output was read.
-
getOutput
- Returns:
- output of the finished process.
You have to invoke
ProcessExecutor.readOutput(boolean)to set the process output to be read. - Throws:
IllegalStateException- if the output was not read.
-
output
public byte[] output()- Returns:
- binary output of the finished process.
You have to invoke
ProcessExecutor.readOutput(boolean)to set the process output to be read. - Throws:
IllegalStateException- if the output was not read.
-
outputString
- Returns:
- output of the finished process converted to a String using platform's default encoding.
You have to invoke
ProcessExecutor.readOutput(boolean)to set the process output to be read. - Throws:
IllegalStateException- if the output was not read.
-
outputUTF8
- Returns:
- output of the finished process converted to UTF-8 String.
You have to invoke
ProcessExecutor.readOutput(boolean)to set the process output to be read. - Throws:
IllegalStateException- if the output was not read.
-
outputString
- Parameters:
charset- The name of a supported char set.- Returns:
- output of the finished process converted to a String.
You have to invoke
ProcessExecutor.readOutput(boolean)to set the process output to be read. - Throws:
IllegalStateException- if the output was not read or the char set was not supported.
-
getExitValue()