chord.util
Class ProcessExecutor

java.lang.Object
  extended by chord.util.ProcessExecutor

public final class ProcessExecutor
extends java.lang.Object

Utility to execute a system command specified as a string in a separate process.

Author:
Mayur Naik (mhn@cs.stanford.edu)

Constructor Summary
ProcessExecutor()
           
 
Method Summary
static int execute(java.lang.String[] cmdarray)
           
static int execute(java.lang.String[] cmdarray, java.lang.String[] envp, java.io.File dir, int timeout)
          Executes a given system command specified as a string in a separate process.
static java.lang.Process executeAsynch(java.lang.String[] cmdarray, java.lang.String[] envp, java.io.File dir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessExecutor

public ProcessExecutor()
Method Detail

execute

public static final int execute(java.lang.String[] cmdarray)
                         throws java.lang.Throwable
Throws:
java.lang.Throwable

execute

public static final int execute(java.lang.String[] cmdarray,
                                java.lang.String[] envp,
                                java.io.File dir,
                                int timeout)
                         throws java.lang.Throwable
Executes a given system command specified as a string in a separate process.

The invoking process waits till the invoked process finishes.

Parameters:
cmdarray - A system command to be executed.
Returns:
The exit value of the invoked process. By convention, 0 indicates normal termination.
Throws:
java.lang.Throwable

executeAsynch

public static final java.lang.Process executeAsynch(java.lang.String[] cmdarray,
                                                    java.lang.String[] envp,
                                                    java.io.File dir)
                                             throws java.lang.Throwable
Throws:
java.lang.Throwable