tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r887195 - /tomcat/trunk/java/org/apache/naming/resources/DirContextURLConnection.java
Date Fri, 04 Dec 2009 13:50:36 GMT
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


Mime
View raw message