Can anyone give me an example of how to stream the output of an external program executed with DefaultExecutor
? I'm not finding any documentation describing how to do this.
My external process will run for several hours, so just grabbing all output data isn't feasible; it must be streamed.
Note: this solution is synchronous, so it won't stream. You'll need to read is in a separate thread, or use the asynchronous version of the execute command.
Below is some sample code for using Runtime.exec. it would be simple to adapt it to your use. From http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=4
EDIT: This does not exactly answer the question, since it uses the JDK classes, but it works.