public class JkProcResult
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
assertSucceed()
Asserts that the process execution succeeded.
|
int |
getExitCode()
Returns the exit code of the process execution.
|
byte[] |
getStderr()
Returns the stderr generated by the executed process.
|
java.lang.String |
getStderrAsString()
Returns the output generated by the executed process as a string, assuming UTF-8 encoding.
|
byte[] |
getStdout()
Returns the stdout generated by the executed process.
|
java.util.List<java.lang.String> |
getStdoutAsMultiline()
Returns the output generated by the executed process as a list of strings, where each string represents a line of output.
|
java.lang.String |
getStdoutAsString()
Returns the output generated by the executed process as a string, assuming UTF-8 encoding.
|
boolean |
hasCollectedStderr()
Returns true if the executed process has collected stdErr.
|
boolean |
hasCollectedStdout()
Returns true if the executed process has collected stdout.
|
boolean |
hasSucceed()
Returns true if the process execution succeeded.
|
public int getExitCode()
public boolean hasSucceed()
0
.public void assertSucceed()
IllegalStateException
if the process
execution failed (i.e. the exit code is not 0).public byte[] getStdout()
public byte[] getStderr()
public boolean hasCollectedStdout()
To collect output, process has to be configured explicitly by invoking JkAbstractProcess.setCollectStdout(boolean)
.
public boolean hasCollectedStderr()
To collect output, process has to be configured explicitly by invoking JkAbstractProcess.setCollectStdout(boolean)
.
public java.lang.String getStdoutAsString()
public java.util.List<java.lang.String> getStdoutAsMultiline()
public java.lang.String getStderrAsString()