This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
If you know the commands beforehand you can just add them to the process builder. Otherwise look at the Sun doc for the methods ;
InputStream getErrorStream() Gets the error stream of the subprocess. InputStream getInputStream() Gets the input stream of the subprocess. OutputStream getOutputStream() Gets the output stream of the subprocess.
It is anyway always a good idea to read the input streams, both normal and error, since if you don't they can over run their buffers and your process will die. You probably want to read these streams in separate threads using a StreamGobbler. There's a good article on Processes and example code for a StreamGobbler on Java World "When Runtime.exec() won't" www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Joined: May 05, 2006
I neglected to add the whole code segment as I'm afraid of looking like I'm not even trying.
I DO have all three code segments.. I will update my original post to show what's going on more accurately.
Edit: Reading the link provided was extremely helpful. [ March 08, 2007: Message edited by: Jonathan Bagshaw ]