public StreamTaskListener(@Nonnull File out, @CheckForNull Charset charset) throws IOException { // don't do buffering so that what's written to the listener // gets reflected to the file immediately, which can then be // served to the browser immediately this(Files.newOutputStream(asPath(out)), charset); }
/** * Constructs a {@link StreamTaskListener} that sends the output to a specified file. * * @param out the file. * @param append if {@code true}, then output will be written to the end of the file rather than the beginning. * @param charset if non-{@code null} then the charset to use when writing. * @throws IOException if the file could not be opened. * @since 1.651 */ public StreamTaskListener(@Nonnull File out, boolean append, @CheckForNull Charset charset) throws IOException { // don't do buffering so that what's written to the listener // gets reflected to the file immediately, which can then be // served to the browser immediately this(Files.newOutputStream( asPath(out), StandardOpenOption.CREATE, append ? StandardOpenOption.APPEND: StandardOpenOption.TRUNCATE_EXISTING ), charset ); }
public StreamTaskListener(File out, Charset charset) throws IOException { // don't do buffering so that what's written to the listener // gets reflected to the file immediately, which can then be // served to the browser immediately this(Files.newOutputStream(asPath(out)), charset); }
/** * Constructs a {@link StreamTaskListener} that sends the output to a specified file. * * @param out the file. * @param append if {@code true}, then output will be written to the end of the file rather than the beginning. * @param charset if non-{@code null} then the charset to use when writing. * @throws IOException if the file could not be opened. * @since 1.651 */ public StreamTaskListener(File out, boolean append, Charset charset) throws IOException { // don't do buffering so that what's written to the listener // gets reflected to the file immediately, which can then be // served to the browser immediately this(Files.newOutputStream( asPath(out), StandardOpenOption.CREATE, append ? StandardOpenOption.APPEND: StandardOpenOption.TRUNCATE_EXISTING ), charset ); }