public class ProcessReader
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
ProcessReader(java.lang.Process process)
Creates a new reader for the given process.
|
ProcessReader(java.lang.Process process,
Processor<java.io.InputStream> processor)
Creates a new reader for the given process.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Waits for the process and related threads to complete.
|
java.lang.String |
getError()
Returns the error stream output from the process.
|
java.lang.String |
getOutput()
Returns the output from standard out from the process.
|
void |
readAll()
Reads the standard output and standard error from the process and waits
for the process to complete.
|
public ProcessReader(java.lang.Process process)
process - the process to read frompublic ProcessReader(java.lang.Process process,
Processor<java.io.InputStream> processor)
process - the process to read fromprocessor - used to process the input stream from the processpublic java.lang.String getError()
public java.lang.String getOutput()
public void readAll()
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedException - thrown if the processing threads are
interruptedjava.io.IOException - thrown if there is an error reading from the processpublic void close()
throws java.lang.InterruptedException,
java.io.IOException
close in interface java.lang.AutoCloseablejava.lang.InterruptedException - thrown if the processing threads are
interruptedjava.io.IOException - thrown if there was an error reading from the processCopyright© 2012-21 Jeremy Long. All Rights Reserved.