Class ExecHelper

java.lang.Object
org.aesh.terminal.utils.ExecHelper

public final class ExecHelper extends Object
Helper methods for capturing an external process output.
Author:
Guillaume Nodet
  • Method Details

    • waitAndCapture

      public static String waitAndCapture(Process p) throws IOException, InterruptedException
      Wait for a process to complete and capture its output. Both stdout and stderr are captured and returned as a single string.
      Parameters:
      p - the process to wait for
      Returns:
      the combined output of stdout and stderr
      Throws:
      IOException - if an I/O error occurs
      InterruptedException - if the thread is interrupted while waiting