cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r582789 - /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
Date Mon, 08 Oct 2007 11:45:30 GMT
Author: lgawron
Date: Mon Oct  8 04:45:29 2007
New Revision: 582789

URL: http://svn.apache.org/viewvc?rev=582789&view=rev
Log:
allow cocoon configurator to work in test environment

Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java?rev=582789&r1=582788&r2=582789&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
Mon Oct  8 04:45:29 2007
@@ -29,8 +29,8 @@
 import org.apache.commons.logging.Log;
 import org.springframework.core.io.Resource;
 import org.springframework.core.io.ResourceLoader;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
 import org.springframework.core.io.support.ResourcePatternResolver;
-import org.springframework.web.context.support.ServletContextResourcePatternResolver;
 
 /**
  * Utility class for Spring resource handling.
@@ -90,7 +90,12 @@
         if (logger != null && logger.isDebugEnabled()) {
             logger.debug("Reading properties from directory: " + propertiesPath);
         }
-        final ResourcePatternResolver resolver = (ResourcePatternResolver) resourceLoader;
+
+        ResourcePatternResolver resolver;
+		if (resourceLoader instanceof ResourcePatternResolver)
+			resolver = (ResourcePatternResolver) resourceLoader;
+		else
+			resolver = new PathMatchingResourcePatternResolver(resourceLoader);
 
         Resource[] resources = null;
 



Mime
View raw message