Class CollectingProcessOutput
java.lang.Object
com.github.fracpete.processoutput4j.output.AbstractProcessOutput
com.github.fracpete.processoutput4j.output.CollectingProcessOutput
- All Implemented Interfaces:
Serializable
Collects the process output (stdout and stderr) and makes them available
once the process finishes.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringBuilderthe stderr content.protected StringBuilderthe stdout content.private static final longfor serialization.Fields inherited from class com.github.fracpete.processoutput4j.output.AbstractProcessOutput
m_Command, m_Environment, m_ExitCode, m_Process, m_ReaderStdErr, m_ReaderStdOut, m_RunnableTimeout, m_TimedOut, m_TimeOut -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractProcessReaderConfigures the reader for stderr.protected AbstractProcessReaderConfigures the reader for stdout.Returns the output on stderr.Returns the output on stdout.protected voidFor initializing the members.static voidAllows the execution of a command through this process output scheme.Methods inherited from class com.github.fracpete.processoutput4j.output.AbstractProcessOutput
configureTimeOutMonitor, destroy, flush, getCommand, getEnvironment, getExitCode, getProcess, getTimeOut, hasSucceeded, hasTimedOut, monitor, monitor, monitor, monitor, monitor, setTimeOut, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDfor serialization.- See Also:
-
m_StdOut
the stdout content. -
m_StdErr
the stderr content.
-
-
Constructor Details
-
CollectingProcessOutput
public CollectingProcessOutput()
-
-
Method Details
-
initialize
protected void initialize()For initializing the members.- Overrides:
initializein classAbstractProcessOutput
-
configureStdErr
Configures the reader for stderr.- Specified by:
configureStdErrin classAbstractProcessOutput- Returns:
- the configured reader
-
configureStdOut
Configures the reader for stdout.- Specified by:
configureStdOutin classAbstractProcessOutput- Parameters:
process- the process to monitor- Returns:
- the configured reader
-
getStdOut
Returns the output on stdout.- Returns:
- the output
-
getStdErr
Returns the output on stderr.- Returns:
- the output
-
main
Allows the execution of a command through this process output scheme.- Parameters:
args- the command to launch- Throws:
Exception- if launching fails for some reason
-