Class ProcessUtil

java.lang.Object
com.sb.jini.ProcessUtil

public final class ProcessUtil extends Object
Utility class for reading output from external processes. Methods read a process's stdout and stderr and combine them into a single string.
  • Constructor Details

    • ProcessUtil

      public ProcessUtil()
  • Method Details

    • readProcessOutput

      public static String readProcessOutput(Process process) throws IOException
      Reads the entire output of the given process (stdout and stderr) and returns it as a single string.
      Parameters:
      process - the process to read from
      Returns:
      combined output of the process
      Throws:
      IOException - if an I/O error occurs while reading the streams