Exemplo n.º 1
0
  /**
   * Executes a file in a new process.
   *
   * @param commandLine The command line to execute. Must begins with the path to executable file.
   * @param workingDir The working directory for the new process to run.
   * @param logFile The file where standard output and standard error streams will be redirected.
   * @param timeoutInSeconds
   * @return Only when process is to the end.
   * @throws IOException
   * @throws InterruptedException
   */
  public int execute(String[] commandLine, File workingDir, File logFile, double timeoutInSeconds) {
    TProcess proc = executeInBackground(commandLine, workingDir, logFile, timeoutInSeconds);

    return proc.waitFor();
  }