Class SubProcess.Runner

  • Enclosing class:
    SubProcess

    public static class SubProcess.Runner
    extends Object
    Fluent runner class for simple subprocess handling.
    • Method Detail

      • withErr

        public SubProcess.Runner withErr​(OutputStream err)
        Set output stream to receive the error output from process. The stream will be forked between the SubProcess.getError() handling and the provided stream.
        Parameters:
        err - The error stream.
        Returns:
        The builder.
      • withOut

        public SubProcess.Runner withOut​(OutputStream out)
        Set output stream to receive the standard output from process. The stream will be forked between the SubProcess.getOutput() handling and the provided stream.
        Parameters:
        out - The output stream.
        Returns:
        The builder.
      • withIn

        public SubProcess.Runner withIn​(InputStream in)
        Set input stream for the subprocess.
        Parameters:
        in - The input stream.
        Returns:
        The builder.
      • withWorkingDir

        public SubProcess.Runner withWorkingDir​(Path workingDir)
        Parameters:
        workingDir - The working dir of the process to be run in.
        Returns:
        The builder.
      • withRuntime

        public SubProcess.Runner withRuntime​(Runtime runtime)
        Parameters:
        runtime - The runtime to use to run the subprocess.
        Returns:
        The builder.
      • withThreadFactory

        public SubProcess.Runner withThreadFactory​(ThreadFactory threadFactory)
        Parameters:
        threadFactory - Thread factory for creating threads for handling IO.
        Returns:
        The builder.
      • withDeadlineMs

        public SubProcess.Runner withDeadlineMs​(long deadlineMs)
        Parameters:
        deadlineMs - Deadline for the process to complete.
        Returns:
        The builder.
      • withDeadlineFlushMs

        public SubProcess.Runner withDeadlineFlushMs​(long deadlineFlushMs)
        Parameters:
        deadlineFlushMs - Deadline for flushing IO streams.
        Returns:
        The builder.