Class ProcessExecutor
- java.lang.Object
-
- org.technologybrewery.orphedomos.util.exec.ProcessExecutor
-
public class ProcessExecutor extends Object
Largely pulled from the com.github.eirslett:frontend-maven-plugin and then updated to better propagate diagnostic error output to the developers. The visibility of this class within the frontend-maven-plugin does not easily facilitate reuse in other modules, so a similar version is maintained here.
-
-
Constructor Summary
Constructors Constructor Description ProcessExecutor(File workingDirectory, List<String> paths, List<String> command, Platform platform, Map<String,String> additionalEnvironment)ProcessExecutor(File workingDirectory, List<String> paths, List<String> command, Platform platform, Map<String,String> additionalEnvironment, long timeoutInSeconds)ProcessExecutor(File workingDirectory, List<String> command, Platform platform, Map<String,String> additionalEnvironment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddisplayProcessOutputForException(ByteArrayOutputStream output, org.slf4j.Logger logger)Helper method that logs the given process output at the error level if its content is not blank.StringexecuteAndGetResult(org.slf4j.Logger logger)intexecuteAndRedirectOutput(org.slf4j.Logger logger)
-
-
-
Constructor Detail
-
ProcessExecutor
public ProcessExecutor(File workingDirectory, List<String> command, Platform platform, Map<String,String> additionalEnvironment)
-
ProcessExecutor
public ProcessExecutor(File workingDirectory, List<String> paths, List<String> command, Platform platform, Map<String,String> additionalEnvironment)
-
-
Method Detail
-
executeAndGetResult
public String executeAndGetResult(org.slf4j.Logger logger)
-
executeAndRedirectOutput
public int executeAndRedirectOutput(org.slf4j.Logger logger)
-
displayProcessOutputForException
protected void displayProcessOutputForException(ByteArrayOutputStream output, org.slf4j.Logger logger)
Helper method that logs the given process output at the error level if its content is not blank.- Parameters:
output-logger-
-
-