Class ProcessHelper

java.lang.Object
io.jans.util.process.ProcessHelper

public final class ProcessHelper extends Object
Utility to execute external processes
Author:
Yuriy Movchan Date: 11.22.2010
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    executeProgram(String programPath, boolean executeInBackground, int successExitValue, OutputStream outputStream)
     
    static boolean
    executeProgram(String programPath, String workingDirectory, boolean executeInBackground, int successExitValue, OutputStream outputStream)
     
    static boolean
    executeProgram(org.apache.commons.exec.CommandLine commandLine, boolean executeInBackground, int successExitValue, OutputStream outputStream)
     
    static io.jans.util.process.ProcessHelper.PrintResultHandler
    executeProgram(org.apache.commons.exec.CommandLine commandLine, long printJobTimeout, boolean printInBackground, int successExitValue, org.apache.commons.exec.ExecuteStreamHandler streamHandler)
     
    static boolean
    executeProgram(org.apache.commons.exec.CommandLine commandLine, String workingDirectory, boolean executeInBackground, int successExitValue, OutputStream outputStream)
     
    static io.jans.util.process.ProcessHelper.PrintResultHandler
    executeProgram(org.apache.commons.exec.CommandLine commandLine, String workingDirectory, long printJobTimeout, boolean printInBackground, int successExitValue, org.apache.commons.exec.ExecuteStreamHandler streamHandler)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • executeProgram

      public static boolean executeProgram(String programPath, boolean executeInBackground, int successExitValue, OutputStream outputStream)
    • executeProgram

      public static boolean executeProgram(String programPath, String workingDirectory, boolean executeInBackground, int successExitValue, OutputStream outputStream)
    • executeProgram

      public static boolean executeProgram(org.apache.commons.exec.CommandLine commandLine, boolean executeInBackground, int successExitValue, OutputStream outputStream)
    • executeProgram

      public static boolean executeProgram(org.apache.commons.exec.CommandLine commandLine, String workingDirectory, boolean executeInBackground, int successExitValue, OutputStream outputStream)
    • executeProgram

      public static io.jans.util.process.ProcessHelper.PrintResultHandler executeProgram(org.apache.commons.exec.CommandLine commandLine, long printJobTimeout, boolean printInBackground, int successExitValue, org.apache.commons.exec.ExecuteStreamHandler streamHandler) throws IOException
      Parameters:
      printJobTimeout - the printJobTimeout (ms) before the watchdog terminates the print process
      printInBackground - printing done in the background or blocking
      streamHandler -
      Returns:
      a print result handler (implementing a future)
      Throws:
      IOException - the test failed
    • executeProgram

      public static io.jans.util.process.ProcessHelper.PrintResultHandler executeProgram(org.apache.commons.exec.CommandLine commandLine, String workingDirectory, long printJobTimeout, boolean printInBackground, int successExitValue, org.apache.commons.exec.ExecuteStreamHandler streamHandler) throws IOException
      Parameters:
      printJobTimeout - the printJobTimeout (ms) before the watchdog terminates the print process
      printInBackground - printing done in the background or blocking
      streamHandler -
      Returns:
      a print result handler (implementing a future)
      Throws:
      IOException - the test failed