Class CommandLineUtil

java.lang.Object
com.jk.core.java.CommandLineUtil

public class CommandLineUtil extends Object
This class provides a static method for executing commands and capturing the command output
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Details

    • CommandLineUtil

      public CommandLineUtil()
  • Method Details

    • exec

      public static void exec(String command, Path rootFolder) throws IOException, InterruptedException
      This method executes a command on the command line and captures the output.
      Parameters:
      command - Specifies the command to be executed.
      rootFolder - Specifies the root folder where the command should be executed.
      Throws:
      IOException - if an I/O error occurs during execution.
      InterruptedException - if execution is interrupted.