tardate.execshell
Class ExecShell

java.lang.Object
  extended by tardate.execshell.ExecShell

public class ExecShell
extends java.lang.Object

Execute external process calls, with input/output handling. See also: http://www.devx.com/tips/Tip/14667 http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part3/Chapter23/runExtProg.html


Constructor Summary
ExecShell()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static java.lang.String runShellCommand(java.lang.String theCmdLine)
          Run an operating system command, assumes no input
static java.lang.String runShellCommand(java.lang.String[] theCmdArray)
          Run an operating system command, assumes no input
static java.lang.String runShellCommand(java.lang.String[] theCmdArray, java.io.BufferedReader sendReader)
          Run an operating system command with buffered command input reader
static java.lang.String runShellCommand(java.lang.String[] theCmdArray, java.io.InputStream send)
          Run an operating system command with input stream
static java.lang.String runShellCommand(java.lang.String[] theCmdArray, java.lang.String send)
          Run an operating system command with input string
static java.lang.String runShellCommand(java.lang.String theCmdLine, java.io.BufferedReader sendReader)
          Run an operating system command with buffered command input reader
static java.lang.String runShellCommand(java.lang.String theCmdLine, java.lang.String send)
          Run an operating system command with input string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecShell

public ExecShell()
Method Detail

runShellCommand

public static java.lang.String runShellCommand(java.lang.String theCmdLine)
                                        throws java.io.IOException
Run an operating system command, assumes no input

Parameters:
theCmdLine - command line (supports double-quoted arguements)
Returns:
String - is the command std output
Throws:
java.io.IOException

runShellCommand

public static java.lang.String runShellCommand(java.lang.String theCmdLine,
                                               java.lang.String send)
                                        throws java.io.IOException
Run an operating system command with input string

Parameters:
theCmdLine - command line (supports double-quoted arguements)
send - command input
Returns:
String - is the command std output
Throws:
java.io.IOException

runShellCommand

public static java.lang.String runShellCommand(java.lang.String theCmdLine,
                                               java.io.BufferedReader sendReader)
                                        throws java.io.IOException
Run an operating system command with buffered command input reader

Parameters:
theCmdLine - command line (supports double-quoted arguements)
sendReader - buffered command input stream
Returns:
String - is the command std output
Throws:
java.io.IOException

runShellCommand

public static java.lang.String runShellCommand(java.lang.String[] theCmdArray)
                                        throws java.io.IOException
Run an operating system command, assumes no input

Parameters:
theCmdArray - command line arguements
Returns:
String is the command std output
Throws:
java.io.IOException

runShellCommand

public static java.lang.String runShellCommand(java.lang.String[] theCmdArray,
                                               java.lang.String send)
                                        throws java.io.IOException
Run an operating system command with input string

Parameters:
theCmdArray - command line arguements
send - command input
Returns:
String is the command std output
Throws:
java.io.IOException

runShellCommand

public static java.lang.String runShellCommand(java.lang.String[] theCmdArray,
                                               java.io.InputStream send)
                                        throws java.io.IOException
Run an operating system command with input stream

Parameters:
theCmdArray - command line arguements
send - command input stream
Returns:
String is the command std output
Throws:
java.io.IOException

runShellCommand

public static java.lang.String runShellCommand(java.lang.String[] theCmdArray,
                                               java.io.BufferedReader sendReader)
                                        throws java.io.IOException
Run an operating system command with buffered command input reader

Parameters:
theCmdArray - command line arguements
sendReader - buffered command input stream
Returns:
String is the command std output
Throws:
java.io.IOException

main

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