cmlenz 2002/08/26 01:30:14
Modified: src/webdav/server/org/apache/slide/webdav/util
DirectoryIndexGenerator.java
Log:
Applied patch submitted by Stephan Michels (stephan at apache.org) to
fix the generation of links in the DirectoryIndexGenerator when a scope
is set. Thanks Stephan!
PR: 12029
Submitted by: Stephan Michels (stephan at apache.org)
Reviewed by: Christopher Lenz (cmlenz at apache.org)
Revision Changes Path
1.3 +12 -11
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/DirectoryIndexGenerator.java
Index: DirectoryIndexGenerator.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/DirectoryIndexGenerator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DirectoryIndexGenerator.java 19 Aug 2002 13:18:23 -0000 1.2
+++ DirectoryIndexGenerator.java 26 Aug 2002 08:30:13 -0000 1.3
@@ -241,18 +241,19 @@
parentDirectory.substring(0, parentDirectory.length() - 1);
}
String scope = config.getScope();
- if (parentDirectory.substring(scope.length()).lastIndexOf("/") >= 0) {
- String parent = name.substring(0, name.lastIndexOf("/"));
+ parentDirectory = parentDirectory.substring(scope.length());
+ if (parentDirectory.lastIndexOf("/") >= 0) {
+ parentDirectory = parentDirectory.substring(0,
parentDirectory.lastIndexOf("/"));
writer.print("<tr><td colspan=\"5\" bgcolor=\"#ffffff\">\r\n");
writer.print("<a href=\"");
writer.print(WebdavUtils.encodeURL(contextPath, "UTF-8"));
- if (parent.equals(""))
- parent = "/";
- writer.print(parent); // I18N chars
+ if (parentDirectory.equals(""))
+ parentDirectory = "/";
+ writer.print(parentDirectory); // I18N chars
writer.print("\">");
writer.print(Messages.format
("org.apache.slide.webdav.GetMethod.parent",
- parent));
+ parentDirectory));
writer.print("</a>\r\n");
writer.print("</td></tr>\r\n");
}
@@ -344,7 +345,7 @@
writer.print("<td align=\"left\" colspan=\"3\"> \r\n");
writer.print("<a href=\"");
- writer.print(WebdavUtils.encodeURL(contextPath + currentResource));
+ writer.print(WebdavUtils.encodeURL(contextPath +
currentResource.substring(scope.length())));
writer.print("\"><tt>");
writer.print(stringToCharacterRef(trimmed)); // I18N chars
if (WebdavUtils.isCollection(currentDescriptor)) {
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>