tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1382855 - /tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
Date Mon, 10 Sep 2012 14:01:08 GMT
Author: markt
Date: Mon Sep 10 14:01:08 2012
New Revision: 1382855

URL: http://svn.apache.org/viewvc?rev=1382855&view=rev
Log:
Need to handle trailing slash being present and not present

Modified:
    tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java

Modified: tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
URL: http://svn.apache.org/viewvc/tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java?rev=1382855&r1=1382854&r2=1382855&view=diff
==============================================================================
--- tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
(original)
+++ tomcat/sandbox/trunk-resources/java/org/apache/catalina/webresources/DirResourceSet.java
Mon Sep 10 14:01:08 2012
@@ -89,7 +89,11 @@ public class DirResourceSet implements W
             String[] list = f.list();
             if (list != null) {
                 for (String entry : list) {
-                    result.add(path + entry);
+                    if (path.charAt(path.length() - 1) == '/') {
+                        result.add(path + entry);
+                    } else {
+                        result.add(path + "/" + entry);
+                    }
                 }
             }
         }



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


Mime
View raw message