You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2010/04/09 07:54:03 UTC

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

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) {