Class SubprocessBuilder


  • public class SubprocessBuilder
    extends java.lang.Object
    A proxy class for java.lang.ProcessBuilder which may be overridden for purposes of test.
    • Constructor Detail

      • SubprocessBuilder

        public SubprocessBuilder()
    • Method Detail

      • builder

        protected java.lang.ProcessBuilder builder()
      • command

        public java.util.List<java.lang.String> command()
        See Also:
        ProcessBuilder.command()
      • command

        public SubprocessBuilder command​(java.util.List<java.lang.String> command)
        See Also:
        ProcessBuilder.command(java.util.List)
      • command

        public SubprocessBuilder command​(java.lang.String... command)
        See Also:
        ProcessBuilder.command(String...)
      • directory

        public java.io.File directory()
        See Also:
        ProcessBuilder.directory()
      • directory

        public SubprocessBuilder directory​(java.io.File directory)
        See Also:
        ProcessBuilder.directory(java.io.File)
      • environment

        public java.util.Map<java.lang.String,​java.lang.String> environment()
        See Also:
        ProcessBuilder.environment()
      • redirectErrorStream

        public boolean redirectErrorStream()
        See Also:
        ProcessBuilder.redirectErrorStream()
      • redirectErrorStream

        public SubprocessBuilder redirectErrorStream​(boolean redirectErrorStream)
        See Also:
        ProcessBuilder.redirectErrorStream(boolean)
      • processBuilder

        public java.lang.ProcessBuilder processBuilder()
      • start

        public java.lang.Process start()
                                throws java.io.IOException
        Throws:
        java.io.IOException
        See Also:
        ProcessBuilder.start()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setStdOutLog

        public void setStdOutLog​(java.util.function.Consumer<java.lang.String> consumer)
        When the process is started , log the process stdout to the Logger. This must be called before starting the process.
        Parameters:
        consumer - Log for std out
      • setStdErrLog

        public void setStdErrLog​(java.util.function.Consumer<java.lang.String> consumer)
        When the process is started , log the process stderr to the Logger. This must be called before starting the process.
        Parameters:
        consumer - Log for std err