public static final class BaseProcessOutputHandler.BaseProcessOutput extends java.lang.Object implements ProcessOutput
Constructor and Description |
---|
BaseProcessOutput() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
com.google.common.io.FileBackedOutputStream |
getErrorOutput()
Returns the OutputStream to use for the error output
|
java.lang.String |
getErrorOutputAsString()
Return the process error output as a String.
|
com.google.common.io.FileBackedOutputStream |
getStandardOutput()
Returns the OutputStream to use for the standard output
|
java.io.Reader |
getStandardOutputAsReader() |
java.lang.String |
getStandardOutputAsString()
Return the process output as a String.
|
<T> T |
processErrorOutputLines(com.google.common.io.LineProcessor<T> lineProcessor) |
<T> T |
processStandardOutputLines(com.google.common.io.LineProcessor<T> lineProcessor)
Process each output line using an implementation of
LineProcessor . |
@NonNull public com.google.common.io.FileBackedOutputStream getStandardOutput()
ProcessOutput
getStandardOutput
in interface ProcessOutput
@NonNull public com.google.common.io.FileBackedOutputStream getErrorOutput()
ProcessOutput
getErrorOutput
in interface ProcessOutput
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
@Nullable public <T> T processErrorOutputLines(@NonNull com.google.common.io.LineProcessor<T> lineProcessor) throws ProcessException
ProcessException
@Nullable public <T> T processStandardOutputLines(@NonNull com.google.common.io.LineProcessor<T> lineProcessor) throws ProcessException
LineProcessor
.T
- the expected result from the line processor (once it has processed part of or
the entire output of the process)lineProcessor
- a processor for a line of output.ProcessException
public java.io.Reader getStandardOutputAsReader() throws java.io.IOException
java.io.IOException
@NonNull public java.lang.String getStandardOutputAsString() throws ProcessException
ProcessException
@NonNull public java.lang.String getErrorOutputAsString() throws ProcessException
ProcessException