public class StreamTaskListener extends AbstractTaskListener implements TaskListener, Closeable
TaskListener
that generates output into a single stream.
This object is remotable.
NULL
Constructor and Description |
---|
StreamTaskListener()
Deprecated.
as of 1.349
Use
TaskListener.NULL |
StreamTaskListener(File out)
Deprecated.
as of TODO
The caller should use
StreamTaskListener(File, Charset) to pass in
the charset and file separately, so that this class can handle encoding correctly. |
StreamTaskListener(File out,
boolean append,
Charset charset)
Constructs a
StreamTaskListener that sends the output to a specified file. |
StreamTaskListener(File out,
Charset charset) |
StreamTaskListener(OutputStream out)
Deprecated.
as of TODO
The caller should use
StreamTaskListener(OutputStream, Charset) to pass in
the charset and output stream separately, so that this class can handle encoding correctly,
or use fromStdout() or fromStderr() . |
StreamTaskListener(OutputStream out,
Charset charset) |
StreamTaskListener(PrintStream out)
Deprecated.
as of 1.349
The caller should use
StreamTaskListener(OutputStream, Charset) to pass in
the charset and output stream separately, so that this class can handle encoding correctly,
or use fromStdout() or fromStderr() . |
StreamTaskListener(Writer w) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
closeQuietly()
Closes this listener and swallows any exceptions, if raised.
|
static StreamTaskListener |
fromStderr() |
static StreamTaskListener |
fromStdout() |
Charset |
getCharset()
A charset to use for methods returning
PrintWriter . |
PrintStream |
getLogger()
This writer will receive the output of the build
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_error, annotate, error, error, fatalError, fatalError, hyperlink
@Deprecated public StreamTaskListener(@NonNull PrintStream out)
StreamTaskListener(OutputStream, Charset)
to pass in
the charset and output stream separately, so that this class can handle encoding correctly,
or use fromStdout()
or fromStderr()
.@Deprecated public StreamTaskListener(@NonNull OutputStream out)
StreamTaskListener(OutputStream, Charset)
to pass in
the charset and output stream separately, so that this class can handle encoding correctly,
or use fromStdout()
or fromStderr()
.public StreamTaskListener(@NonNull OutputStream out, @CheckForNull Charset charset)
@Deprecated public StreamTaskListener(@NonNull File out) throws IOException
StreamTaskListener(File, Charset)
to pass in
the charset and file separately, so that this class can handle encoding correctly.IOException
public StreamTaskListener(@NonNull File out, @CheckForNull Charset charset) throws IOException
IOException
public StreamTaskListener(@NonNull File out, boolean append, @CheckForNull Charset charset) throws IOException
StreamTaskListener
that sends the output to a specified file.out
- the file.append
- if true
, then output will be written to the end of the file rather than the beginning.charset
- if non-null
then the charset to use when writing.IOException
- if the file could not be opened.public StreamTaskListener(@NonNull Writer w) throws IOException
IOException
@Deprecated public StreamTaskListener() throws IOException
TaskListener.NULL
IOException
public static StreamTaskListener fromStdout()
public static StreamTaskListener fromStderr()
public PrintStream getLogger()
TaskListener
getLogger
in interface TaskListener
public Charset getCharset()
TaskListener
PrintWriter
.
Should match that used to construct TaskListener.getLogger()
.getCharset
in interface TaskListener
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void closeQuietly()
Copyright © 2004–2022. All rights reserved.