Author: dims
Date: Tue Aug 15 14:03:56 2006
New Revision: 431701

URL: http://svn.apache.org/viewvc?rev=431701&view=rev
Log:
Loader.getResource is enough and does the job. Discovery is too heavy weight 
for such a small thing

Removed:
    webservices/wss4j/trunk/legal/LICENSE.commons-discovery
    webservices/wss4j/trunk/lib/commons-discovery-0.2.jar
Modified:
    
webservices/wss4j/trunk/src/org/apache/ws/security/components/crypto/AbstractCrypto.java

Modified: 
webservices/wss4j/trunk/src/org/apache/ws/security/components/crypto/AbstractCrypto.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/components/crypto/AbstractCrypto.java?rev=431701&r1=431700&r2=431701&view=diff
==============================================================================
--- 
webservices/wss4j/trunk/src/org/apache/ws/security/components/crypto/AbstractCrypto.java
 (original)
+++ 
webservices/wss4j/trunk/src/org/apache/ws/security/components/crypto/AbstractCrypto.java
 Tue Aug 15 14:03:56 2006
@@ -16,10 +16,6 @@
  */
 package org.apache.ws.security.components.crypto;
 
-import org.apache.commons.discovery.Resource;
-import org.apache.commons.discovery.ResourceIterator;
-import org.apache.commons.discovery.jdk.JDKHooks;
-import org.apache.commons.discovery.resource.DiscoverResources;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.security.WSSecurityException;
@@ -90,28 +86,8 @@
         }
         this.properties = properties;
         String location = 
this.properties.getProperty("org.apache.ws.security.crypto.merlin.file");
-        InputStream is = null;
 
-        try {
-            /**
-             * Look for the keystore in classpaths using commons discovery
-             */
-            DiscoverResources disc = new DiscoverResources();
-            
disc.addClassLoader(JDKHooks.getJDKHooks().getThreadContextClassLoader());
-            disc.addClassLoader(loader);
-            ResourceIterator iterator = disc.findResources(location);
-            if (iterator.hasNext()) {
-                Resource resource = iterator.nextResource();
-                is = resource.getResourceAsStream();
-            }
-        } catch (java.lang.NoClassDefFoundError ex) {
-            /**
-             * Look for the keystore in classpaths using TCCL
-             */
-            if (is == null) {
-                is = Loader.getResource(loader, location).openStream();
-            }
-        }
+        InputStream is = Loader.getResource(loader, location).openStream();
 
         /**
          * If we don't find it, then look on the file system.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to