public class StandardOutput extends Object
stdout should be consumed.| Modifier and Type | Class and Description |
|---|---|
static class |
StandardOutput.Target
The target for the the output stream.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<ProcessBuilder.Redirect> |
getRedirect()
An option redirect for the
stdout. |
Path |
getStdoutPath()
The path to the file where the data was written.
|
StandardOutput.Target |
getTarget()
The target the data was written to.
|
static StandardOutput |
parse(String stdout,
boolean discardNone)
Parses the string and attempts to determine where the data for the stream should be written.
|
Optional<Thread> |
startConsumer(Process process)
If the processes
stdout should be consumed a thread which consumes it will be started. |
String |
toString() |
public static StandardOutput parse(String stdout, boolean discardNone) throws IOException
none indicates the data for this stream will be consumed and toString() will return the
data of the discardNone parameter is false, otherwise the data will be discardedSystem.out or System.err to write to the respective streamstdout - the value to be parseddiscardNone - true if the stdout value is none and the data should be discarded,
otherwise the data will be consumed if the stdout value is none and will be
available via toString()IOException - if there is an error creating the streampublic Optional<ProcessBuilder.Redirect> getRedirect()
stdout.public Optional<Thread> startConsumer(Process process)
stdout should be consumed a thread which consumes it will be started.process - the process to possibly start the thread forpublic Path getStdoutPath()
null if the data was not written to a file.public StandardOutput.Target getTarget()
Copyright © 2017 JBoss by Red Hat. All rights reserved.