Author: chris.laprun(a)jboss.com
Date: 2007-01-17 19:40:25 -0500 (Wed, 17 Jan 2007)
New Revision: 6025
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java
Log:
- JBPORTAL-1204: Use getResources and keep the last one returned to make sure we get the
deepest/more specific one on the path.
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java 2007-01-17
22:17:59 UTC (rev 6024)
+++
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java 2007-01-18
00:40:25 UTC (rev 6025)
@@ -31,6 +31,7 @@
import org.jboss.xb.binding.UnmarshallerFactory;
import java.net.URL;
+import java.util.Enumeration;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -69,7 +70,15 @@
{
throw new Exception("The config location is null");
}
- URL configURL =
Thread.currentThread().getContextClassLoader().getResource(configLocation);
+
+ // make sure we pick the furthest down the path in case there's several
similarly named resources in the path
+ Enumeration enum =
Thread.currentThread().getContextClassLoader().getResources(configLocation);
+ URL configURL = null;
+ while (enum.hasMoreElements())
+ {
+ configURL = (URL)enum.nextElement();
+ }
+
if (configURL == null)
{
throw new Exception("The config " + configLocation + " does not
exist");
Show replies by date