[jbosstools-commits] JBoss Tools SVN: r41075 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed May 16 13:48:30 EDT 2012


Author: adietish
Date: 2012-05-16 13:48:28 -0400 (Wed, 16 May 2012)
New Revision: 41075

Modified:
   trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
Log:
[JBIDE-11861] now using a variable name (static prefix 'jbosstools' + timestamp) to store the ssh key to the pass (was: static name)

Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java	2012-05-16 15:55:36 UTC (rev 41074)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java	2012-05-16 17:48:28 UTC (rev 41075)
@@ -13,6 +13,8 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
 
 import org.eclipse.core.runtime.Preferences;
 import org.eclipse.jsch.internal.core.IConstants;
@@ -106,10 +108,17 @@
 		ISSHPublicKey sshKey = loadSshKey();
 		IOpenShiftSSHKey sshKeyResource = user.getSSHKeyByPublicKey(sshKey.getPublicKey());
 		if (sshKeyResource == null) {
-			user.putSSHKey(SSHKEY_DEFAULT_NAME, sshKey);
+			user.putSSHKey(getTimestampKeyname(), sshKey);
 		}
 	}
 
+	private String getTimestampKeyname() {
+		return new StringBuilder(
+				SSHKEY_DEFAULT_NAME)
+				.append(new SimpleDateFormat("yyyyMMddhmS").format(new Date()))
+				.toString();
+	}
+
 	public String getSshKey() {
 		return sshKey;
 	}



More information about the jbosstools-commits mailing list