com.mizar.commons.io
Class CommandRunner

java.lang.Object
  extended by com.mizar.commons.io.CommandRunner
Direct Known Subclasses:
DcrawRunner

public class CommandRunner
extends java.lang.Object


Constructor Summary
CommandRunner()
           
CommandRunner(java.lang.String commandLine)
           
 
Method Summary
 void clear()
           
static java.util.List<java.lang.String> exec(java.lang.String commandLine, java.lang.String[] envp, java.io.File dir)
           
 int exitValue()
           
protected  void finalize()
           
 java.lang.String getCommandLine()
           
 java.io.File getDir()
           
 java.lang.String[] getEnvp()
           
 java.util.List<java.lang.String> getErrors()
           
 java.util.List<java.lang.String> getResponse()
           
static void main(java.lang.String[] args)
           
 java.util.List<java.lang.String> run()
           
static java.util.List<java.lang.String> run(CommandRunner cr)
           
 java.util.List<java.lang.String> run(java.lang.Process process)
           
 java.util.List<java.lang.String> run(java.lang.String commandLine)
           
 java.util.List<java.lang.String> run(java.lang.String commandLine, java.lang.String[] envp)
           
 java.util.List<java.lang.String> run(java.lang.String commandLine, java.lang.String[] envp, java.io.File dir)
           
 void setCommandLine(java.lang.String commandLine)
           
 void setDir(java.io.File dir)
           
 void setEnvp(java.lang.String[] envp)
           
 void setLdLibraryPath()
           
 void setLdLibraryPath(java.lang.String ldLibraryPath)
           
 void setOracleHome()
           
 void setOracleHome(java.lang.String ldLibraryPath)
           
 int waitFor()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandRunner

public CommandRunner()

CommandRunner

public CommandRunner(java.lang.String commandLine)
Method Detail

exec

public static java.util.List<java.lang.String> exec(java.lang.String commandLine,
                                                    java.lang.String[] envp,
                                                    java.io.File dir)
                                             throws java.io.IOException
Throws:
java.io.IOException

run

public static java.util.List<java.lang.String> run(CommandRunner cr)
Parameters:
cr -
Returns:
the result of a CommandRunner.run call but includes errors if they occur.

run

public java.util.List<java.lang.String> run()
                                     throws java.io.IOException
Throws:
java.io.IOException

run

public java.util.List<java.lang.String> run(java.lang.String commandLine,
                                            java.lang.String[] envp,
                                            java.io.File dir)
                                     throws java.io.IOException
Throws:
java.io.IOException

run

public java.util.List<java.lang.String> run(java.lang.String commandLine,
                                            java.lang.String[] envp)
                                     throws java.io.IOException
Throws:
java.io.IOException

run

public java.util.List<java.lang.String> run(java.lang.String commandLine)
                                     throws java.io.IOException
Throws:
java.io.IOException

run

public java.util.List<java.lang.String> run(java.lang.Process process)
                                     throws java.io.IOException
Throws:
java.io.IOException

waitFor

public int waitFor()
            throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

exitValue

public int exitValue()
              throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

clear

public void clear()

setCommandLine

public void setCommandLine(java.lang.String commandLine)

getCommandLine

public java.lang.String getCommandLine()

setLdLibraryPath

public void setLdLibraryPath()

setLdLibraryPath

public void setLdLibraryPath(java.lang.String ldLibraryPath)

setOracleHome

public void setOracleHome()

setOracleHome

public void setOracleHome(java.lang.String ldLibraryPath)

setEnvp

public void setEnvp(java.lang.String[] envp)
Parameters:
envp - environment variables, e.g. LD_LIBRARY_PATH=/usr/local/lib:$ORACLE/lib

getEnvp

public java.lang.String[] getEnvp()

setDir

public void setDir(java.io.File dir)

getDir

public java.io.File getDir()

getResponse

public java.util.List<java.lang.String> getResponse()

getErrors

public java.util.List<java.lang.String> getErrors()

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

main

public static void main(java.lang.String[] args)