Class ProcessExecutor

    • Constructor Summary

      Constructors 
      Constructor Description
      ProcessExecutor​(java.lang.String command, java.lang.String... options)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute​(java.io.OutputStream outputStream)
      Execute current process.
      void execute​(java.io.OutputStream outputStream, long timeoutInMilliseconds)
      Execute current process.
      boolean isFinished()
      Check current process finish or not.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ProcessExecutor

        public ProcessExecutor​(java.lang.String command,
                               java.lang.String... options)
        Constructor
        Parameters:
        command - command
        options - command options
    • Method Detail

      • execute

        public void execute​(java.io.OutputStream outputStream)
                     throws java.io.IOException
        Execute current process.

        // * @param inputStream input stream keeps output stream from process

        Parameters:
        outputStream - output stream for process normal or error input stream.
        Throws:
        java.io.IOException - if process execution is failed.
      • execute

        public void execute​(java.io.OutputStream outputStream,
                            long timeoutInMilliseconds)
                     throws java.io.IOException,
                            java.util.concurrent.TimeoutException
        Execute current process.

        // * @param inputStream input stream keeps output stream from process

        Parameters:
        outputStream - output stream for process normal or error input stream.
        timeoutInMilliseconds - milliseconds timeout
        Throws:
        java.io.IOException - if process execution is failed.
        java.util.concurrent.TimeoutException - if the execution is timeout over specified timeoutInMilliseconds
      • isFinished

        public boolean isFinished()
        Check current process finish or not.
        Returns:
        true if current process finished