public Object[] getElements(Object parent) { if (defaultPrefs.equals(parent)) return new Object[] {SecurePreferencesFactory.getDefault()}; return new Object[0]; }
public Object[] getElements(Object parent) { if (defaultPrefs.equals(parent)) return new Object[] {SecurePreferencesFactory.getDefault()}; return new Object[0]; }
public void validateSave() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; boolean modified = (root == null) ? false : InternalExchangeUtils.isModified(root); buttonSave.setEnabled(modified); }
public void validateSave() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; boolean modified = (root == null) ? false : InternalExchangeUtils.isModified(root); buttonSave.setEnabled(modified); }
protected void enableButtons() { String moduleID = getSelectedModuleID(); if (moduleID == null) { // nothing selected buttonChangePassword.setEnabled(false); buttonRecoverPassword.setEnabled(false); } else { buttonChangePassword.setEnabled(true); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String path = PASSWORD_RECOVERY_NODE + moduleID; boolean recoveryAvailable = rootNode.nodeExists(path); buttonRecoverPassword.setEnabled(recoveryAvailable); } enableLogout(); }
protected void enableButtons() { String moduleID = getSelectedModuleID(); if (moduleID == null) { // nothing selected buttonChangePassword.setEnabled(false); buttonRecoverPassword.setEnabled(false); } else { buttonChangePassword.setEnabled(true); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String path = PASSWORD_RECOVERY_NODE + moduleID; boolean recoveryAvailable = rootNode.nodeExists(path); buttonRecoverPassword.setEnabled(recoveryAvailable); } enableLogout(); }
/** * Returns location of default storage * @return location of the default storage, might be null */ static public URL defaultStorageLocation() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return null; return ((SecurePreferencesWrapper) defaultStorage).getContainer().getLocation(); }
/** * Returns location of default storage * @return location of the default storage, might be null */ static public URL defaultStorageLocation() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return null; return ((SecurePreferencesWrapper) defaultStorage).getContainer().getLocation(); }
private static ISecurePreferences getSecureServersNode() { return SecurePreferencesFactory.getDefault().node(SonarLintCorePlugin.PLUGIN_ID).node(ServersManager.PREF_SERVERS); }
public void widgetSelected(SelectionEvent e) { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; try { root.flush(); } catch (IOException exception) { Activator.log(IStatus.ERROR, exception.getMessage(), null, exception); } validateSave(); // save could fail so re-check } });
/** * Answer secured preferences which can be used for storing sensitive * information of this tab * * @return default instance of secure preferences for this tab, * <code>null</code> if application was unable to create secure * preferences using default location */ private ISecurePreferences getPreferences(String sectionName) { ISecurePreferences preferences = SecurePreferencesFactory.getDefault(); if (preferences == null) { return null; } return preferences.node(IPDEUIConstants.PLUGIN_ID).node(sectionName); } }
protected void export() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; ExportDialog dialog = new ExportDialog(shell); dialog.open(); String fileName = dialog.getFileName(); if (fileName == null) return; File outputFile = new File(fileName); PrintStream output; try { output = new PrintStream(new FileOutputStream(outputFile)); } catch (FileNotFoundException e) { Activator.log(IStatus.ERROR, e.getMessage(), null, e); return; } export(root, output); output.flush(); output.close(); }
protected void export() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return; ExportDialog dialog = new ExportDialog(shell); dialog.open(); String fileName = dialog.getFileName(); if (fileName == null) return; File outputFile = new File(fileName); PrintStream output; try { output = new PrintStream(new FileOutputStream(outputFile)); } catch (FileNotFoundException e) { Activator.log(IStatus.ERROR, e.getMessage(), null, e); return; } export(root, output); output.flush(); output.close(); }
private ISecurePreferences getSecurePreferences() { if (!securePreferencesDisabled.get()) { String serverId = getServerId(); if (serverId != null) { ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault().node( CloudFoundryPlugin.PLUGIN_ID); securePreferences = securePreferences.node(EncodingUtils.encodeSlashes(serverId)); return securePreferences; } } return null; }
static void setCredentials(URI location, String username, String password, MavenLogger logger) { ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
private ISecurePreferences getNode() { ISecurePreferences root = SecurePreferencesFactory.getDefault(); if (root == null) return null; ISecurePreferences node = root.node(PREFERENCES_CONTEXT); if (getName() != null) return node.node(getName()); return node; }
/** * Closes open default storage, if any, and deletes the actual file. */ static public void defaultStorageDelete() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return; URL location = defaultStorageLocation(); if (location == null) return; // clear the default preferences store from the mapper SecurePreferencesMapper.clearDefault(); // delete the actual file if (StorageUtils.exists(location)) StorageUtils.delete(location); // FUTURE: this is a good place to notify delete listeners }
/** * Closes open default storage, if any, and deletes the actual file. */ static public void defaultStorageDelete() { ISecurePreferences defaultStorage = SecurePreferencesFactory.getDefault(); if (defaultStorage == null) return; URL location = defaultStorageLocation(); if (location == null) return; // clear the default preferences store from the mapper SecurePreferencesMapper.clearDefault(); // delete the actual file if (StorageUtils.exists(location)) StorageUtils.delete(location); // FUTURE: this is a good place to notify delete listeners }
public void widgetSelected(SelectionEvent e) { String moduleID = getSelectedModuleID(); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String[] questions = InternalExchangeUtils.getPasswordRecoveryQuestions(rootNode, moduleID); if (questions.length == 0) return; // no password recovery questions were setup PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID); dialog.open(); enableLogout(); } });
public void widgetSelected(SelectionEvent e) { String moduleID = getSelectedModuleID(); ISecurePreferences rootNode = SecurePreferencesFactory.getDefault(); String[] questions = InternalExchangeUtils.getPasswordRecoveryQuestions(rootNode, moduleID); if (questions.length == 0) return; // no password recovery questions were setup PasswordRecoveryDialog dialog = new PasswordRecoveryDialog(questions, shell, moduleID); dialog.open(); enableLogout(); } });