use of org.eclipse.che.plugin.debugger.ide.configuration.dto.DebugConfigurationDto in project che by eclipse.
the class DebugConfigurationsManagerImpl method saveConfigurations.
private void saveConfigurations() {
if (localStorageOptional.isPresent()) {
List<DebugConfigurationDto> configurationDtos = new ArrayList<>();
for (DebugConfiguration configuration : configurations) {
configurationDtos.add(dtoFactory.createDto(DebugConfigurationDto.class).withType(configuration.getType().getId()).withName(configuration.getName()).withHost(configuration.getHost()).withPort(configuration.getPort()).withConnectionProperties(configuration.getConnectionProperties()));
}
localStorageOptional.get().setItem(LOCAL_STORAGE_DEBUG_CONF_KEY, dtoFactory.toJson(configurationDtos));
}
}
use of org.eclipse.che.plugin.debugger.ide.configuration.dto.DebugConfigurationDto in project che by eclipse.
the class DebugConfigurationsManagerImpl method retrieveConfigurations.
private List<DebugConfigurationDto> retrieveConfigurations() {
List<DebugConfigurationDto> configurationsList;
if (localStorageOptional.isPresent()) {
final LocalStorage localStorage = localStorageOptional.get();
final Optional<String> data = Optional.fromNullable(localStorage.getItem(LOCAL_STORAGE_DEBUG_CONF_KEY));
if (data.isPresent() && !data.get().isEmpty()) {
configurationsList = dtoFactory.createListDtoFromJson(data.get(), DebugConfigurationDto.class);
} else {
configurationsList = emptyList();
}
} else {
configurationsList = emptyList();
}
return configurationsList;
}
Aggregations