harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r464389 - in /incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool: KeyStoreConverter.java KeytoolKSLoaderSaver.java KeytoolParameters.java
Date Mon, 16 Oct 2006 05:59:06 GMT
Author: smishura
Date: Sun Oct 15 22:59:05 2006
New Revision: 464389

URL: http://svn.apache.org/viewvc?view=rev&rev=464389
Log:
Apply patch for HARMONY-1851 ([classlib][tools] Keytool - code refactoring)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolKSLoaderSaver.java
    incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java?view=diff&rev=464389&r1=464388&r2=464389
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeyStoreConverter.java
Sun Oct 15 22:59:05 2006
@@ -26,6 +26,8 @@
 import java.security.cert.CertificateException;
 import java.util.Enumeration;
 
+import org.apache.harmony.tools.toolutils.KeyStoreLoaderSaver;
+
 /**
  * Class to convert keystore to another format.
  */
@@ -51,7 +53,7 @@
         String ksProvider = (param.getConvKsProvider() != null) ? param
                 .getConvKsProvider() : param.getProvider();
         // creating a new keystore
-        KeyStore convertedKS = KeytoolKSLoaderSaver.loadStore(null, param
+        KeyStore convertedKS = KeyStoreLoaderSaver.loadStore(null, param
                 .getConvertedKeyStoreType(), param.getConvertedKeyStorePass(),
                 ksProvider);
 
@@ -121,7 +123,7 @@
         }
             
         // save the converted keystore
-        KeytoolKSLoaderSaver.saveStore(convertedKS, param
+        KeyStoreLoaderSaver.saveStore(convertedKS, param
                 .getConvertedKeyStorePath(), param.getConvertedKeyStorePass(),
                 param.isVerbose());
     }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolKSLoaderSaver.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolKSLoaderSaver.java?view=diff&rev=464389&r1=464388&r2=464389
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolKSLoaderSaver.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolKSLoaderSaver.java
Sun Oct 15 22:59:05 2006
@@ -35,7 +35,7 @@
 /**
  * Class for loading the main keystore, saving ang changing its password.
  */
-public class KeytoolKSLoaderSaver extends KeyStoreLoaderSaver{
+public class KeytoolKSLoaderSaver {
     /**
      * Creates an instance of class KeyStore and loads a keystore to it.
      * param.getStorePass() is used to check the integrity of the keystore. If
@@ -72,15 +72,17 @@
             ksFile = new File(uri);
         } catch (URISyntaxException e) {
             ksFile = new File(param.getStorePath());
+        } catch (IllegalArgumentException e){
+            ksFile = new File(param.getStorePath());
         }
         if (ksFile.exists()) {
             // load an existing store
-            keyStore = loadStore(param.getStorePath(), param.getStoreType(),
-                    param.getStorePass(), ksProvider);
+            keyStore = KeyStoreLoaderSaver.loadStore(param.getStorePath(),
+                    param.getStoreType(), param.getStorePass(), ksProvider);
         } else {
             // create a new store if it doesn't exist
-            keyStore = loadStore(null, param.getStoreType(), param
-                    .getStorePass(), ksProvider);
+            keyStore = KeyStoreLoaderSaver.loadStore(null,
+                    param.getStoreType(), param.getStorePass(), ksProvider);
             param.setNeedSaveKS(true);
         }
         param.setKeyStore(keyStore);
@@ -94,13 +96,13 @@
      * @throws NoSuchAlgorithmException
      * @throws CertificateException
      * @throws IOException
-     * @throws NoSuchProviderException 
+     * @throws NoSuchProviderException
      */
     static void saveStore(KeytoolParameters param) throws KeyStoreException,
             NoSuchAlgorithmException, CertificateException, IOException,
-            NoSuchProviderException{
-        saveStore(param.getKeyStore(), param.getStorePath(), param
-                .getStorePass(), param.isVerbose());
+            NoSuchProviderException {
+        KeyStoreLoaderSaver.saveStore(param.getKeyStore(),
+                param.getStorePath(), param.getStorePass(), param.isVerbose());
     }
 
     /**

Modified: incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java?view=diff&rev=464389&r1=464388&r2=464389
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/tools/src/main/java/org/apache/harmony/tools/keytool/KeytoolParameters.java
Sun Oct 15 22:59:05 2006
@@ -26,6 +26,8 @@
 import java.security.NoSuchProviderException;
 import java.security.cert.CertificateException;
 
+import org.apache.harmony.tools.toolutils.KeyStoreLoaderSaver;
+
 /**
  * The class encapsulates paramaters for Keytool most of which are ususally given
  * in command line.
@@ -891,7 +893,7 @@
             NoSuchProviderException, IOException {
         if (cacerts == null) {
             String keyStoreProv = (ksProvider != null) ? ksProvider : provider;
-            cacerts = KeytoolKSLoaderSaver.loadStore(getCacertsPath(),
+            cacerts = KeyStoreLoaderSaver.loadStore(getCacertsPath(),
                     storeType, getCacertsPass(), keyStoreProv);
         }
         return cacerts;



Mime
View raw message