Author: adietish
Date: 2010-10-25 10:55:46 -0400 (Mon, 25 Oct 2010)
New Revision: 26033
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7402] cleanup: extracted storePassword() method
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-10-25
14:32:07 UTC (rev 26032)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-10-25
14:55:46 UTC (rev 26033)
@@ -84,14 +84,7 @@
instanceFilter.setRules(IInstanceFilter.ALL_STRING);
}
if (persistent) {
- ISecurePreferences root = SecurePreferencesFactory.getDefault();
- String key = DeltaCloud.getPreferencesKey(url, username);
- ISecurePreferences node = root.node(key);
- try {
- node.put("password", passwd, true /*encrypt*/);
- } catch (StorageException e) {
- e.printStackTrace();
- }
+ storePassword(url, username, passwd);
}
}
@@ -101,6 +94,10 @@
this.name = name;
this.username = username;
this.type = type;
+ storePassword(url, username, passwd);
+ }
+
+ private void storePassword(String url, String username, String passwd) {
ISecurePreferences root = SecurePreferencesFactory.getDefault();
String key = DeltaCloud.getPreferencesKey(url, username);
ISecurePreferences node = root.node(key);
Show replies by date