use of org.jkiss.dbeaver.runtime.encode.EncryptionException in project dbeaver by dbeaver.
the class PrefPageDrivers method performOk.
@Override
public boolean performOk() {
DBPPreferenceStore store = DBWorkbench.getPlatform().getPreferenceStore();
store.setValue(ModelPreferences.UI_DRIVERS_VERSION_UPDATE, versionUpdateCheck.getSelection());
store.setValue(ModelPreferences.UI_PROXY_HOST, proxyHostText.getText());
store.setValue(ModelPreferences.UI_PROXY_PORT, proxyPortSpinner.getSelection());
store.setValue(ModelPreferences.UI_PROXY_USER, proxyUserText.getText());
String password = proxyPasswordText.getText();
if (!CommonUtils.isEmpty(password) && encrypter != null) {
// Encrypt password
try {
password = encrypter.encrypt(password);
} catch (EncryptionException e) {
log.warn(e);
}
}
store.setValue(ModelPreferences.UI_PROXY_PASSWORD, password);
store.setValue(ModelPreferences.UI_DRIVERS_HOME, customDriversHome.getText());
{
StringBuilder sources = new StringBuilder();
for (String item : sourceList.getItems()) {
if (sources.length() > 0)
sources.append('|');
sources.append(item);
}
store.setValue(ModelPreferences.UI_DRIVERS_SOURCES, sources.toString());
}
PrefUtils.savePreferenceStore(store);
return super.performOk();
}
Aggregations