Class ProcessHelper

java.lang.Object
org.aesh.terminal.tty.utils.ProcessHelper

public final class ProcessHelper extends Object
Utility for executing external processes and capturing their output.
Author:
Ståle W. Pedersen
  • Method Details

    • execute

      public static ProcessHelper.ProcessResult execute(String... command)
      Execute a command and capture its output.
      Parameters:
      command - the command and arguments
      Returns:
      the process result
    • execute

      public static ProcessHelper.ProcessResult execute(long timeoutMs, String... command)
      Execute a command with a timeout and capture its output.
      Parameters:
      timeoutMs - timeout in milliseconds
      command - the command and arguments
      Returns:
      the process result