/** Loads debugger information from the local storage. */ protected void restoreDebuggerState() { invalidateDebugSession(); LocalStorage localStorage = localStorageProvider.get(); if (localStorage == null) { return; } String data = localStorage.getItem(LOCAL_STORAGE_DEBUGGER_SESSION_KEY); if (!Strings.isNullOrEmpty(data)) { DebugSessionDto debugSessionDto = dtoFactory.createDtoFromJson(data, DebugSessionDto.class); if (!debugSessionDto.getType().equals(getDebuggerType())) { return; } setDebugSession(debugSessionDto); } data = localStorage.getItem(LOCAL_STORAGE_DEBUGGER_STATE_KEY); if (!Strings.isNullOrEmpty(data)) { suspendEventDto = dtoFactory.createDtoFromJson(data, SuspendEventDto.class); } data = localStorage.getItem(LOCAL_STORAGE_DEBUGGER_DISPOSABLE_BREAKPOINT_KEY); if (!Strings.isNullOrEmpty(data)) { disposableBreakpoint = dtoFactory.createDtoFromJson(data, BreakpointDto.class); } }
/** Returns commands for the specified {@code project}. */ List<CommandImpl> getCommands(Project project) { List<String> attrValues = project.getAttributes(COMMANDS_ATTRIBUTE_NAME); if (attrValues == null) { return new ArrayList<>(); } Map<String, CommandImpl> commands = new HashMap<>(attrValues.size()); for (String commandJson : attrValues) { try { CommandDto commandDto = dtoFactory.createDtoFromJson(commandJson, CommandDto.class); commands.put(commandDto.getName(), new CommandImpl(commandDto)); } catch (JSONException e) { Log.error( ProjectCommandManagerDelegate.class, "Unable to parse command of project '" + project.getPath() + "': " + commandJson + ". " + e.getMessage()); } } return new ArrayList<>(commands.values()); }
errorMessage = dtoFactory.createDtoFromJson(errorMessage, ServiceError.class).getMessage(); if (errorMessage.equals("Unable get private ssh key")) { console.printError(locale.messagesUnableGetSshKey());
errorMessage = dtoFactory.createDtoFromJson(errorMessage, ServiceError.class).getMessage(); if (errorMessage.equals("Unable get private ssh key")) { console.printError(locale.messagesUnableGetSshKey());