Class ProcessService

java.lang.Object
com.sidneysimmons.kimber.service.ProcessService

public class ProcessService extends Object
Service class for executing processes.
  • Constructor Details

    • ProcessService

      public ProcessService()
      Generic constructor.
  • Method Details

    • executeAndLog

      public void executeAndLog(List<String> command, Map<String,String> environmentVariables) throws ProcessExecutionException
      Execute the given process command and log the output.
      Parameters:
      command - the command
      environmentVariables - any environment variables to set on the new process (optional)
      Throws:
      ProcessExecutionException - thrown if there is a problem executing the command
    • executeAndCapture

      public List<String> executeAndCapture(List<String> command, Map<String,String> environmentVariables) throws ProcessExecutionException
      Execute the given process command and capture the output.
      Parameters:
      command - the command
      environmentVariables - any environment variables to set on the new process (optional)
      Returns:
      the output
      Throws:
      ProcessExecutionException - thrown if there is a problem executing the command