Package com.sidneysimmons.kimber.service
Class ProcessService
java.lang.Object
com.sidneysimmons.kimber.service.ProcessService
Service class for executing processes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecute the given process command and capture the output.voidExecute the given process command and log the output.
-
Constructor Details
-
ProcessService
public ProcessService()Generic constructor.
-
-
Method Details
-
executeAndLog
public void executeAndLog(List<String> command, Map<String, String> environmentVariables) throws ProcessExecutionExceptionExecute the given process command and log the output.- Parameters:
command- the commandenvironmentVariables- 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 ProcessExecutionExceptionExecute the given process command and capture the output.- Parameters:
command- the commandenvironmentVariables- any environment variables to set on the new process (optional)- Returns:
- the output
- Throws:
ProcessExecutionException- thrown if there is a problem executing the command
-