Class DefaultExecuteResultHandler

    • Method Detail

      • getException

        public ExecuteException getException()
        Gets the exception causing the process execution to fail.
        Returns:
        the exception.
        Throws:
        java.lang.IllegalStateException - if the process has not exited yet.
      • getExitValue

        public int getExitValue()
        Gets the exitValue of the process.
        Returns:
        the exitValue.
        Throws:
        java.lang.IllegalStateException - if the process has not exited yet.
      • hasResult

        public boolean hasResult()
        Tests whether the process exited and a result is available, i.e. exitCode or exception?
        Returns:
        true whether a result of the execution is available.
      • waitFor

        public void waitFor()
                     throws java.lang.InterruptedException
        Causes the current thread to wait, if necessary, until the process has terminated. This method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.
        Throws:
        java.lang.InterruptedException - if the current thread is interrupted by another thread while it is waiting, then the wait is ended and an InterruptedException is thrown.
      • waitFor

        public void waitFor​(java.time.Duration timeout)
                     throws java.lang.InterruptedException
        Causes the current thread to wait, if necessary, until the process has terminated. This method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.
        Parameters:
        timeout - the maximum time to wait.
        Throws:
        java.lang.InterruptedException - if the current thread is interrupted by another thread while it is waiting, then the wait is ended and an InterruptedException is thrown.
        Since:
        1.4.0
      • waitFor

        @Deprecated
        public void waitFor​(long timeoutMillis)
                     throws java.lang.InterruptedException
        Deprecated.
        Causes the current thread to wait, if necessary, until the process has terminated. This method returns immediately if the process has already terminated. If the process has not yet terminated, the calling thread will be blocked until the process exits.
        Parameters:
        timeoutMillis - the maximum time to wait in milliseconds.
        Throws:
        java.lang.InterruptedException - if the current thread is interrupted by another thread while it is waiting, then the wait is ended and an InterruptedException is thrown.