public class CommandHandlerImpl extends Object implements CommandHandler
| Constructor and Description |
|---|
CommandHandlerImpl() |
| 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 void runCommandWithReturnCodeCheck(String command, boolean showStdout, String workingDirectory, List<Long> validReturnCodes, String errorMessage) throws AzureExecutionException
runCommandWithReturnCodeCheck in interface CommandHandlerAzureExecutionExceptionpublic String runCommandAndGetOutput(String command, boolean showStdout, String workingDirectory) throws AzureExecutionException
runCommandAndGetOutput in interface CommandHandlerAzureExecutionExceptionprotected String getOutputFromProcess(Process process) throws IOException
IOExceptionprotected Process runCommand(String command, boolean showStdout, String workingDirectory) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected static ProcessBuilder.Redirect getStdoutRedirect(boolean showStdout)
protected void handleExitValue(int exitValue,
List<Long> validReturnCodes,
String errorMessage,
InputStream inputStream)
throws AzureExecutionException,
IOException
AzureExecutionExceptionIOExceptionprotected void showErrorIfAny(InputStream inputStream) throws IOException
IOExceptionCopyright © 2020. All rights reserved.