Class PrefixedStreamingProcessOwner
java.lang.Object
com.github.fracpete.processoutput4j.core.impl.PrefixedStreamingProcessOwner
- All Implemented Interfaces:
StreamingProcessOwner
Simple class for streaming a process's stdout/stderr to this stdout,
but prefixing each line with the appropriate stdout/stderr prefix.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInitializes the output using the default prefixes.PrefixedStreamingProcessOwner(String prefixStdOut, String prefixStdErr) Initializes the output using the specified prefixes. -
Method Summary
Modifier and TypeMethodDescriptionReturns what output from the process to forward.voidprocessOutput(String line, boolean stdout) Processes the incoming line.
-
Field Details
-
DEFAULT_PREFIX_STDOUT
default prefix for stdout.- See Also:
-
DEFAULT_PREFIX_STDERR
default prefix for stderr.- See Also:
-
m_PrefixStdOut
the prefix for stdout. -
m_PrefixStdErr
the prefix for stderr.
-
-
Constructor Details
-
PrefixedStreamingProcessOwner
public PrefixedStreamingProcessOwner()Initializes the output using the default prefixes.- See Also:
-
PrefixedStreamingProcessOwner
Initializes the output using the specified prefixes.- Parameters:
prefixStdOut- the prefix for stdoutprefixStdErr- the prefix for stderr
-
-
Method Details
-
getOutputType
Returns what output from the process to forward.- Specified by:
getOutputTypein interfaceStreamingProcessOwner- Returns:
- StreamingProcessOutputType#BOTH
-
processOutput
Processes the incoming line.- Specified by:
processOutputin interfaceStreamingProcessOwner- Parameters:
line- the line to processstdout- whether stdout or stderr
-