public class CommandHandlerImpl extends Object implements CommandHandler
| Modifier and Type | Field and Description |
|---|---|
private org.apache.maven.plugin.logging.Log |
logger |
| Constructor and Description |
|---|
CommandHandlerImpl(org.apache.maven.plugin.logging.Log logger) |
| Modifier and Type | Method and Description |
|---|---|
protected static String[] |
buildCommand(String command) |
protected String |
getOutputFromProcess(Process process) |
protected static ProcessBuilder.Redirect |
getStdoutRedirect(boolean showStdout) |
protected void |
handleExitValue(int exitValue,
List<Long> validReturnCodes,
String errorMessage,
InputStream inputStream) |
protected Process |
runCommand(String command,
boolean showStdout,
String workingDirectory) |
String |
runCommandAndGetOutput(String command,
boolean showStdout,
String workingDirectory) |
void |
runCommandWithReturnCodeCheck(String command,
boolean showStdout,
String workingDirectory,
List<Long> validReturnCodes,
String errorMessage) |
protected void |
showErrorIfAny(InputStream inputStream) |
public CommandHandlerImpl(org.apache.maven.plugin.logging.Log logger)
public void runCommandWithReturnCodeCheck(String command, boolean showStdout, String workingDirectory, List<Long> validReturnCodes, String errorMessage) throws Exception
runCommandWithReturnCodeCheck in interface CommandHandlerExceptionpublic String runCommandAndGetOutput(String command, boolean showStdout, String workingDirectory) throws Exception
runCommandAndGetOutput in interface CommandHandlerExceptionprotected String getOutputFromProcess(Process process) throws IOException
IOExceptionprotected Process runCommand(String command, boolean showStdout, String workingDirectory) throws Exception
Exceptionprotected static ProcessBuilder.Redirect getStdoutRedirect(boolean showStdout)
protected void handleExitValue(int exitValue,
List<Long> validReturnCodes,
String errorMessage,
InputStream inputStream)
throws Exception
Exceptionprotected void showErrorIfAny(InputStream inputStream) throws Exception
ExceptionCopyright © 2019. All rights reserved.