You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2009/12/04 14:50:36 UTC

svn commit: r887195 - /tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java

Author: markt
Date: Fri Dec  4 13:50:36 2009
New Revision: 887195

URL: http://svn.apache.org/viewvc?rev=887195&view=rev
Log:
Need to strip /hostname/contextpath before trying to list resources

Modified:
    tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java

Modified: tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java?rev=887195&r1=887194&r2=887195&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java (original)
+++ tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java Fri Dec  4 13:50:36 2009
@@ -421,8 +421,13 @@
         
         if (collection != null) {
             try {
+                String file = getURL().getFile();
+                // This will be of the form /<hostname>/<contextpath/file name
+                // Strip off the hostname and the contextpath
+                int start = file.indexOf('/', file.indexOf('/', 1) + 1);
+                
                 NamingEnumeration<NameClassPair> enumeration =
-                    context.list(getURL().getFile());
+                    context.list(file.substring(start));
                 while (enumeration.hasMoreElements()) {
                     NameClassPair ncp = enumeration.nextElement();
                     result.addElement(ncp.getName());



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org