geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r932260 - /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
Date Fri, 09 Apr 2010 05:54:03 GMT
Author: xuhaihong
Date: Fri Apr  9 05:54:03 2010
New Revision: 932260

URL: http://svn.apache.org/viewvc?rev=932260&view=rev
Log:
Return BundleDirContext while the request path is a folder

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java?rev=932260&r1=932259&r2=932260&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/BundleDirContext.java
Fri Apr  9 05:54:03 2010
@@ -1429,12 +1429,15 @@ public class BundleDirContext implements
 
     protected Object doLookup(String name) throws NamingException {
         name = getName(name);
-        // XXX: lookup on directory should return BundleDirContext?
         URL url = BundleUtils.getEntry(bundle, name);
         if (url == null) {
             throw new NamingException(sm.getString("resources.notFound", name));
         }
-        return new URLResource(url);
+        if (url.toString().endsWith("/")) {
+            return new BundleDirContext(bundle, name);
+        } else {
+            return new URLResource(url);
+        }
     }
 
     private String getName(String name) {



Mime
View raw message