Author: adietish
Date: 2010-12-15 03:34:42 -0500 (Wed, 15 Dec 2010)
New Revision: 27491
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/SecurePasswordStore.java
Log:
cleanup
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java 2010-12-15
03:27:56 UTC (rev 27490)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudPasswordStorageKey.java 2010-12-15
08:34:42 UTC (rev 27491)
@@ -14,7 +14,7 @@
import org.jboss.tools.deltacloud.core.SecurePasswordStore.IStorageKey;
/**
- * Implements a key to be used to store keywords with.
+ * Implements a key to be used to store values in the preferences store.
*
* @author Andre Dietisheim
*
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/SecurePasswordStore.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/SecurePasswordStore.java 2010-12-15
03:27:56 UTC (rev 27490)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/SecurePasswordStore.java 2010-12-15
08:34:42 UTC (rev 27491)
@@ -16,14 +16,11 @@
/**
* @author Andre Dietisheim
- *
- * TODO: remove DeltaCloudException
*/
public class SecurePasswordStore {
public static interface IStorageKey {
public String getKey();
-
public boolean equals(IStorageKey key);
}
@@ -47,6 +44,7 @@
try {
return this.password = getFromPreferences(storageKey);
} catch (StorageException e) {
+ // TODO: internationalize strings
throw new DeltaCloudException("Could get password", e);
}
}
@@ -58,12 +56,12 @@
public void update(IStorageKey key, String password) throws DeltaCloudException {
if (!storageKey.equals(key)
- || hasPasswordChanged(password)) {
+ || isPasswordChanged(password)) {
storeInPreferences(this.password = password, this.storageKey = key);
}
}
- private boolean hasPasswordChanged(String password) {
+ private boolean isPasswordChanged(String password) {
if (this.password == null && password == null) {
return false;
} else {
@@ -76,6 +74,7 @@
public void remove() throws DeltaCloudException {
ISecurePreferences node = getNode(storageKey);
if (node == null) {
+ // TODO: internationalize strings
throw new DeltaCloudException("Could not remove password");
}
node.clear();