In the ProcessBuilder
documentation three methods are provided to redirect the output of a process.
ProcessBuilder.Redirect redirectOutput()
ProcessBuilder redirectOutput(File file)
ProcessBuilder redirectOutput(ProcessBuilder.Redirect destination)
Question : I want to redirect the process output into a stream instead of a File
, how this can be achieved.?
Here is the documentation : https://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html