activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject [4/5] git commit: https://issues.apache.org/jira/browse/AMQ-4682 - support classpath urls
Date Mon, 02 Sep 2013 23:40:07 GMT
https://issues.apache.org/jira/browse/AMQ-4682 - support classpath urls


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/9f26e0b6
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/9f26e0b6
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/9f26e0b6

Branch: refs/heads/trunk
Commit: 9f26e0b6400b1a2a81e86122386b54c2e3e37d5c
Parents: 3222767
Author: gtully <gtully@apache.org>
Authored: Tue Sep 3 00:36:49 2013 +0100
Committer: gtully <gtully@apache.org>
Committed: Tue Sep 3 00:36:49 2013 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/activemq/spring/Utils.java     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/9f26e0b6/activemq-spring/src/main/java/org/apache/activemq/spring/Utils.java
----------------------------------------------------------------------
diff --git a/activemq-spring/src/main/java/org/apache/activemq/spring/Utils.java b/activemq-spring/src/main/java/org/apache/activemq/spring/Utils.java
index 0f7ac1a..ba776e6 100644
--- a/activemq-spring/src/main/java/org/apache/activemq/spring/Utils.java
+++ b/activemq-spring/src/main/java/org/apache/activemq/spring/Utils.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.spring;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.net.MalformedURLException;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.FileSystemResource;
@@ -32,7 +33,13 @@ public class Utils {
         if (file.exists()) {
             resource = new FileSystemResource(uri);
         } else if (ResourceUtils.isUrl(uri)) {
-            resource = new UrlResource(uri);
+            try {
+                resource = new UrlResource(ResourceUtils.getURL(uri));
+            } catch (FileNotFoundException e) {
+                MalformedURLException malformedURLException = new MalformedURLException(uri);
+                malformedURLException.initCause(e);
+                throw  malformedURLException;
+            }
         } else {
             resource = new ClassPathResource(uri);
         }


Mime
View raw message