geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viol...@apache.org
Subject svn commit: r1183230 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
Date Fri, 14 Oct 2011 07:24:11 GMT
Author: violalu
Date: Fri Oct 14 07:24:10 2011
New Revision: 1183230

URL: http://svn.apache.org/viewvc?rev=1183230&view=rev
Log:
GERONIMO-6187 filter keystore files under var/security/keystores

Modified:
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java?rev=1183230&r1=1183229&r2=1183230&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/keystore/FileKeystoreManager.java
Fri Oct 14 07:24:10 2011
@@ -127,7 +127,26 @@ public class FileKeystoreManager impleme
         for (int i = 0; i < files.length; i++) {
             File file = files[i];
             if(file.canRead() && !file.isDirectory()) {
-                list.add(file.getName());
+                String name = file.getName();
+                if (name.lastIndexOf(".") == -1) {
+                    list.add(file.getName());
+                } else {
+                    String type = name.substring(name.lastIndexOf(".") + 1);    
+                    if (file.length()> 0){
+                        for(String ktype : KeystoreUtil.keystoreTypes ){
+                            if (ktype.toLowerCase().equals(type.toLowerCase())){        
                       
+                                list.add(file.getName());
+                            }
+                        }
+                    } else if (file.length() == 0){
+                        for (String ktype : KeystoreUtil.emptyKeystoreTypes){
+                            if (ktype.toLowerCase().equals(type.toLowerCase())){        
               
+                                list.add(file.getName());
+                            }
+                        }
+                    }
+                }
+                            
             }
         }
         return (String[]) list.toArray(new String[list.size()]);



Mime
View raw message