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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to