Package org.wildfly.plugin.common
Class StandardOutput
java.lang.Object
org.wildfly.plugin.common.StandardOutput
Information on how the
stdout should be consumed.- Author:
- James R. Perkins
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe target for the the output stream. -
Method Summary
Modifier and TypeMethodDescriptionAn option redirect for thestdout.The path to the file where the data was written.The target the data was written to.static booleanstatic StandardOutputParses the string and attempts to determine where the data for the stream should be written.static StandardOutputParses the string and attempts to determine where the data for the stream should be written.The following are the options for the value:noneindicates the data for this stream will be consumed andtoString()will return the data of thediscardNoneparameter isfalse, otherwise the data will be discardedSystem.outorSystem.errto write to the respective stream Any other value is assumed to be the path to a file and the data will written to the filestartConsumer(Process process) If the processesstdoutshould be consumed a thread which consumes it will be started.toString()
-
Method Details
-
parse
Parses the string and attempts to determine where the data for the stream should be written. The following are the options for the value:noneindicates the data for this stream will be consumed andtoString()will return the data of thediscardNoneparameter isfalse, otherwise the data will be discardedSystem.outorSystem.errto write to the respective stream- Any other value is assumed to be the path to a file and the data will written to the file
- Parameters:
stdout- the value to be parseddiscardNone-trueif thestdoutvalue isnoneand the data should be discarded, otherwise the data will be consumed if thestdoutvalue isnoneand will be available viatoString()- Returns:
- a new output stream
- Throws:
IOException- if there is an error creating the stream
-
parse
public static StandardOutput parse(String stdout, boolean discardNone, boolean append) throws IOException Parses the string and attempts to determine where the data for the stream should be written.The following are the options for the value:noneindicates the data for this stream will be consumed andtoString()will return the data of thediscardNoneparameter isfalse, otherwise the data will be discardedSystem.outorSystem.errto write to the respective stream- Any other value is assumed to be the path to a file and the data will written to the file
- Parameters:
stdout- the value to be parseddiscardNone-trueif thestdoutvalue isnoneand the data should be discarded, otherwise the data will be consumed if thestdoutvalue isnoneand will be available viatoString()append- If stdout is a file, append output to existing file if true, otherwise a new file is created.- Returns:
- a new output stream
- Throws:
IOException- if there is an error creating the stream
-
isFile
-
getRedirect
An option redirect for thestdout.- Returns:
- the optional redirect
-
startConsumer
If the processesstdoutshould be consumed a thread which consumes it will be started.- Parameters:
process- the process to possibly start the thread for- Returns:
- the optional thread
-
getStdoutPath
The path to the file where the data was written.- Returns:
- the path to where the data was written, otherwise
} if the data was not written to a file.
invalid @link
{@link null
-
getTarget
The target the data was written to.- Returns:
- the target
-
toString
-