public class PrintStreamWrapper extends Object
PrintStream
for writing content to
and a corresponding getContent()
method to get the content
which has been written to the PrintStream.
The reason is from the async Pipeline Handle
we don't have
an active TaskListener.getLogger()
anymore this means everything
written to the PrintStream (logger) will not be printed to the Pipeline log.
Therefore we provide this PrintStream for logging and the content can be
obtained later via getContent()
.Constructor and Description |
---|
PrintStreamWrapper() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the streams.
|
String |
getContent()
Returns all logs since creation and closes the streams.
|
PrintStream |
getPrintStream() |
public PrintStreamWrapper() throws UnsupportedEncodingException
UnsupportedEncodingException
public PrintStream getPrintStream()
public String getContent() throws IOException
IOException
- if UTF-8 charset is not supported.public void close()
Copyright © 2016–2023. All rights reserved.