public static boolean executeInDir(String command, File commandOutputFile, String dir) {
        CommandResult commandResult = null;
        try {
            commandResult = execute(command, commandOutputFile, dir, null);
        } catch (IOException | HyscaleException e) {
            HyscaleException ex = new HyscaleException(e, CommonErrorCode.FAILED_TO_EXECUTE_COMMAND, command);
            logger.error("Failed while executing command, error {}", ex.toString());
            return false;
        }
        return commandResult.getExitCode() == 0;
    }
@param command           to be executed
@param commandOutputFile to which command output is redirected
@param dir               in which command is executed
@return whether command was successful or not
commons/src/main/java/io/hyscale/commons/commands/CommandExecutor.java