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.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Throwable |
exception()
Returns my exception.
|
java.lang.Integer |
exitStatus()
Returns my exit status.
|
boolean |
hasException()
Tests whether I have an exception.
|
boolean |
hasExitStatus()
Tests whether I have an exit status.
|
boolean |
hasStderr()
Tests whether I have standard-error data.
|
boolean |
hasStdout()
Tests whether I have standard-output data.
|
java.nio.ByteBuffer |
stderr()
Returns my standard-error data.
|
java.lang.String |
stderrString()
Returns my standard-error data as a string decoded using the default
character set.
|
java.lang.String |
stderrString(java.nio.charset.Charset cs)
Returns my standard-error data as a string decoded using character set
cs . |
java.nio.ByteBuffer |
stdout()
Returns my standard-output data.
|
java.lang.String |
stdoutString()
Returns my standard-output data as a string decoded using the default
character set.
|
java.lang.String |
stdoutString(java.nio.charset.Charset cs)
Returns my standard-output data as a string decoded using character set
cs . |
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 I have an exit status; false
otherwisepublic java.lang.Integer exitStatus()
null
if nonepublic boolean hasException()
true
if I have an exception; false
otherwisepublic java.lang.Throwable exception()
null
if nonepublic boolean hasStdout()
true
if I have 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
.cs
- character set to decode data withnull
if nonepublic boolean hasStderr()
true
if I have 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
.cs
- character set to decode data withnull
if none