ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1752804 - /webservices/wss4j/branches/2_1_x-fixes/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java
Date Fri, 15 Jul 2016 09:15:54 GMT
Author: coheigea
Date: Fri Jul 15 09:15:53 2016
New Revision: 1752804

URL: http://svn.apache.org/viewvc?rev=1752804&view=rev
Log:
Check for a URL when loading Crypto resources

Modified:
    webservices/wss4j/branches/2_1_x-fixes/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java

Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java?rev=1752804&r1=1752803&r2=1752804&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java
(original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/Merlin.java
Fri Jul 15 09:15:53 2016
@@ -23,6 +23,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigInteger;
+import java.net.MalformedURLException;
 import java.security.GeneralSecurityException;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.Key;
@@ -345,7 +346,17 @@ public class Merlin extends CryptoBase {
         throws WSSecurityException, IOException {
         InputStream is = null;
         if (location != null) {
-            java.net.URL url = Loader.getResource(loader, location);
+            java.net.URL url = null;
+            // First see if it's a URL
+            try {
+                url = new java.net.URL(location);
+            } catch (MalformedURLException ex) { //NOPMD
+                // skip
+            }
+            // If not a URL, then try to load the resource
+            if (url == null) {
+                url = Loader.getResource(loader, location);
+            }
             if (url != null) {
                 is = url.openStream();
             }



Mime
View raw message