public class ProcessRunnerResult
extends java.lang.Object
ProcessRunner
.Constructor and Description |
---|
ProcessRunnerResult(java.lang.Integer exitStatus,
java.lang.Throwable exception,
java.nio.ByteBuffer stdout,
java.nio.ByteBuffer stderr)
Creates an instance with the specified exit status, exception, standard
output data, and standard error data.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
exception()
Returns the exception.
|
java.lang.Integer |
exitStatus()
Returns the exit status.
|
boolean |
hasException()
Tests whether this has an exception.
|
boolean |
hasExitStatus()
Tests whether this has an exit status.
|
boolean |
hasStderr()
Tests whether this has standard-error data.
|
boolean |
hasStdout()
Tests whether this has standard-output data.
|
java.nio.ByteBuffer |
stderr()
Returns the standard-error data.
|
java.lang.String |
stderrString()
Returns the standard-error data as a string decoded using the default
character set.
|
java.lang.String |
stderrString(java.nio.charset.Charset cs)
Returns the standard-error data as a string decoded using the specified
character set.
|
java.nio.ByteBuffer |
stdout()
Returns the standard-output data.
|
java.lang.String |
stdoutString()
Returns the standard-output data as a string decoded using the default
character set.
|
java.lang.String |
stdoutString(java.nio.charset.Charset cs)
Returns the standard-output data as a string decoded using the specified
character set.
|
public ProcessRunnerResult(java.lang.Integer exitStatus, java.lang.Throwable exception, java.nio.ByteBuffer stdout, java.nio.ByteBuffer stderr)
exitStatus
- exit status of the process or null
if noneexception
- exception causing abnormal termination of the
ProcessRunner
or null
if nonestdout
- data read from the standard-output stream of the process or
null
if nonestderr
- data read from the standard-error stream of the process or
null
if nonepublic boolean hasExitStatus()
true
if has an exit status; false
otherwisepublic java.lang.Integer exitStatus()
null
if nonepublic boolean hasException()
true
if has an exception; false
otherwisepublic java.lang.Throwable exception()
null
if nonepublic boolean hasStdout()
true
if has standard-output data; false
otherwisepublic java.nio.ByteBuffer stdout()
The data is returned as a ByteBuffer
with its limit set to the
size of the data. The ByteBuffer
is backed by an array, so calling
ByteBuffer.array()
will always succeed.
null
if nonepublic java.lang.String stdoutString()
null
if nonepublic java.lang.String stdoutString(java.nio.charset.Charset cs)
cs
- character set to decode data withnull
if nonepublic boolean hasStderr()
true
if has standard-error data; false
otherwisepublic java.nio.ByteBuffer stderr()
The data is returned as a ByteBuffer
with its limit set to the
size of the data. The ByteBuffer
is backed by an array, so calling
ByteBuffer.array()
will always succeed.
null
if nonepublic java.lang.String stderrString()
null
if nonepublic java.lang.String stderrString(java.nio.charset.Charset cs)
cs
- character set to decode data withnull
if none