Package org.qbicc.machine.tool.process
Class OutputDestination
java.lang.Object
org.qbicc.machine.tool.process.OutputDestination
A destination to send input to.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OutputDestinationAn output destination that efficiently discards the input.static <T> OutputDestinationof(io.smallrye.common.function.ExceptionBiConsumer<T, InputStream, IOException> consumer, T param) An output destination that calls the given consumer with an input stream.static <T> OutputDestinationof(io.smallrye.common.function.ExceptionBiConsumer<T, Reader, IOException> consumer, T param, Charset charset) An output destination that calls the given consumer with a reader.static OutputDestinationof(io.smallrye.common.function.ExceptionConsumer<InputStream, IOException> consumer) An output destination that calls the given consumer with an input stream.static OutputDestinationof(io.smallrye.common.function.ExceptionConsumer<Reader, IOException> consumer, Charset charset) An output destination that calls the given consumer with a reader.static <T> OutputDestinationof(io.smallrye.common.function.ExceptionFunction<T, OutputStream, IOException> supplier, T param) An output destination that writes to an output stream provided by the given supplier.static <T> OutputDestinationof(io.smallrye.common.function.ExceptionFunction<T, Appendable, IOException> supplier, T param, Charset charset) An output destination that writes to an appendable provided by the given supplier.static <T> OutputDestinationof(io.smallrye.common.function.ExceptionFunction<T, ProcessBuilder, IOException> supplier, T param, OutputDestination errorDest, OutputDestination outputDest) An output destination that pipes into a process.static <T> OutputDestinationof(io.smallrye.common.function.ExceptionFunction<T, ProcessBuilder, IOException> supplier, T param, OutputDestination errorDest, OutputDestination outputDest, io.smallrye.common.function.ExceptionConsumer<Process, IOException> checker) An output destination that pipes into a process.static OutputDestinationof(io.smallrye.common.function.ExceptionSupplier<OutputStream, IOException> supplier) An output destination that writes to an output stream provided by the given supplier.static OutputDestinationof(io.smallrye.common.function.ExceptionSupplier<Appendable, IOException> supplier, Charset charset) An output destination that writes to an appendable provided by the given supplier.static OutputDestinationof(io.smallrye.common.function.ExceptionSupplier<ProcessBuilder, IOException> supplier, OutputDestination errorDest, OutputDestination outputDest) An output destination that pipes into a process.static OutputDestinationof(io.smallrye.common.function.ExceptionSupplier<ProcessBuilder, IOException> supplier, OutputDestination errorDest, OutputDestination outputDest, io.smallrye.common.function.ExceptionConsumer<Process, IOException> checker) An output destination that pipes into a process.static OutputDestinationof(Appendable appendable) An output destination that writes to the givenAppendable.static OutputDestinationof(Appendable appendable, Charset charset) An output destination that writes to the givenAppendable.static OutputDestinationof(ProcessBuilder processBuilder, OutputDestination errorDest, OutputDestination outputDest) An output destination that pipes into a process.static OutputDestinationof(ProcessBuilder processBuilder, OutputDestination errorDest, OutputDestination outputDest, io.smallrye.common.function.ExceptionConsumer<Process, IOException> checker) An output destination that pipes into a process.static OutputDestinationAn output destination that writes to a file on the filesystem.
-
Method Details
-
discarding
An output destination that efficiently discards the input.- Returns:
- the output destination
-
of
public static <T> OutputDestination of(io.smallrye.common.function.ExceptionBiConsumer<T, InputStream, IOException> consumer, T param) An output destination that calls the given consumer with an input stream.- Type Parameters:
T- the parameter type- Parameters:
consumer- the stream consumer (must not benull)param- the parameter to pass to the stream consumer- Returns:
- the output destination
-
of
public static OutputDestination of(io.smallrye.common.function.ExceptionConsumer<InputStream, IOException> consumer) An output destination that calls the given consumer with an input stream.- Parameters:
consumer- the stream consumer (must not benull)- Returns:
- the output destination
-
of
public static <T> OutputDestination of(io.smallrye.common.function.ExceptionFunction<T, OutputStream, IOException> supplier, T param) An output destination that writes to an output stream provided by the given supplier.- Type Parameters:
T- the parameter type- Parameters:
supplier- the stream supplier (must not benull)param- the parameter to pass to the stream supplier- Returns:
- the output destination
-
of
public static OutputDestination of(io.smallrye.common.function.ExceptionSupplier<OutputStream, IOException> supplier) An output destination that writes to an output stream provided by the given supplier.- Parameters:
supplier- the stream supplier (must not benull)- Returns:
- the output destination
-
of
public static <T> OutputDestination of(io.smallrye.common.function.ExceptionBiConsumer<T, Reader, IOException> consumer, T param, Charset charset) An output destination that calls the given consumer with a reader.- Type Parameters:
T- the parameter type- Parameters:
consumer- the stream consumer (must not benull)param- the parameter to pass to the stream consumercharset- the character set (must not benull)- Returns:
- the output destination
-
of
public static OutputDestination of(io.smallrye.common.function.ExceptionConsumer<Reader, IOException> consumer, Charset charset) An output destination that calls the given consumer with a reader.- Parameters:
consumer- the stream consumer (must not benull)charset- the character set (must not benull)- Returns:
- the output destination
-
of
public static <T> OutputDestination of(io.smallrye.common.function.ExceptionFunction<T, Appendable, IOException> supplier, T param, Charset charset) An output destination that writes to an appendable provided by the given supplier. The appendable will be closed if it implementsCloseable.- Type Parameters:
T- the parameter type- Parameters:
supplier- the supplier (must not benull)param- the parameter to pass to the stream suppliercharset- the character set (must not benull)- Returns:
- the output destination
-
of
public static OutputDestination of(io.smallrye.common.function.ExceptionSupplier<Appendable, IOException> supplier, Charset charset) An output destination that writes to an appendable provided by the given supplier. The appendable will be closed if it implementsCloseable.- Parameters:
supplier- the stream supplier (must not benull)charset- the character set (must not benull)- Returns:
- the output destination
-
of
An output destination that writes to a file on the filesystem.- Parameters:
path- the path to write to (must not benull)- Returns:
- the output destination
-
of
An output destination that writes to the givenAppendable. Note that the destination is not reusable.- Parameters:
appendable- the appendable to write tocharset- the character set (must not benull)- Returns:
- the output destination
-
of
An output destination that writes to the givenAppendable. Note that the destination is not reusable. The UTF-8 character set is assumed.- Parameters:
appendable- the appendable to write to- Returns:
- the output destination
-
of
public static <T> OutputDestination of(io.smallrye.common.function.ExceptionFunction<T, ProcessBuilder, IOException> supplier, T param, OutputDestination errorDest, OutputDestination outputDest) An output destination that pipes into a process. The process builder's redirection settings will be overwritten.- Type Parameters:
T- the parameter type- Parameters:
supplier- the process builder supplier (must not benull)param- the parameter to pass to the process builder suppliererrorDest- the output destination for the process error stream (must not benull)outputDest- the output destination for the process output stream (must not benull)- Returns:
- the output destination
-
of
public static <T> OutputDestination of(io.smallrye.common.function.ExceptionFunction<T, ProcessBuilder, IOException> supplier, T param, OutputDestination errorDest, OutputDestination outputDest, io.smallrye.common.function.ExceptionConsumer<Process, IOException> checker) An output destination that pipes into a process. The process builder's redirection settings will be overwritten.- Type Parameters:
T- the parameter type- Parameters:
supplier- the process builder supplier (must not benull)param- the parameter to pass to the process builder suppliererrorDest- the output destination for the process error stream (must not benull)outputDest- the output destination for the process output stream (must not benull)checker- the process exit code checker to use (must not benull)- Returns:
- the output destination
-
of
public static OutputDestination of(io.smallrye.common.function.ExceptionSupplier<ProcessBuilder, IOException> supplier, OutputDestination errorDest, OutputDestination outputDest) An output destination that pipes into a process. The process builder's redirection settings will be overwritten.- Parameters:
supplier- the process builder supplier (must not benull)errorDest- the output destination for the process error stream (must not benull)outputDest- the output destination for the process output stream (must not benull)- Returns:
- the output destination
-
of
public static OutputDestination of(io.smallrye.common.function.ExceptionSupplier<ProcessBuilder, IOException> supplier, OutputDestination errorDest, OutputDestination outputDest, io.smallrye.common.function.ExceptionConsumer<Process, IOException> checker) An output destination that pipes into a process. The process builder's redirection settings will be overwritten.- Parameters:
supplier- the process builder supplier (must not benull)errorDest- the output destination for the process error stream (must not benull)outputDest- the output destination for the process output stream (must not benull)checker- the process exit code checker to use (must not benull)- Returns:
- the output destination
-
of
public static OutputDestination of(ProcessBuilder processBuilder, OutputDestination errorDest, OutputDestination outputDest) An output destination that pipes into a process. The process builder's redirection settings will be overwritten. Note that the returned output destination reuses the same process builder and thus is not thread safe.- Parameters:
processBuilder- the process builder, which will be reused on every usage (must not benull)errorDest- the output destination for the process error stream (must not benull)outputDest- the output destination for the process output stream (must not benull)- Returns:
- the output destination
-
of
public static OutputDestination of(ProcessBuilder processBuilder, OutputDestination errorDest, OutputDestination outputDest, io.smallrye.common.function.ExceptionConsumer<Process, IOException> checker) An output destination that pipes into a process. The process builder's redirection settings will be overwritten. Note that the returned output destination reuses the same process builder and thus is not thread safe.- Parameters:
processBuilder- the process builder, which will be reused on every usage (must not benull)errorDest- the output destination for the process error stream (must not benull)outputDest- the output destination for the process output stream (must not benull)checker- the process exit code checker to use (must not benull)- Returns:
- the output destination
-