I noticed a bug in the client lib when requesting childs for resources that
have escaped characters in the path. In this situation the collection
resource is also returned as a child.

The reason is that the href of the response is compared with the escaped
path of the collection resource. Because of this the collection is not
identified in the response.

In the appended patch this is fixed by escaping the href too before the
compare. I do the escape by creating a temporary HttpURL object. Does anyone
know another way to escape the path without escaping the slashes in the
path? HttpURL does this.

Martin

---------------
Martin Dulisch
Open Source Group, S&N AG
[EMAIL PROTECTED]
Index: WebdavResource.java
===================================================================
retrieving revision 1.1
diff -u -r1.1 WebdavResource.java
--- WebdavResource.java 9 Jan 2004 09:56:04 -0000       1.1
+++ WebdavResource.java 12 Jan 2004 11:22:11 -0000
@@ -1,7 +1,7 @@
 /*
- * $Header: 
/home/cvspublic/jakarta-slide/webdavclient/clientlib/src/java/org/apache/webdav/lib/WebdavResource.java,v
 1.1 2004/01/09 09:56:04 ib Exp $
- * $Revision: 1.1 $
- * $Date: 2004/01/09 09:56:04 $
+ * $Header: 
/home/cvspublic/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/WebdavResource.java,v
 1.69 2003/09/25 12:45:27 ib Exp $
+ * $Revision: 1.69 $
+ * $Date: 2003/09/25 12:45:27 $
  *
  * ====================================================================
  *
@@ -911,15 +911,15 @@
 
         // Make the resources in the collection empty.
         childResources.removeAll();
+        HttpURL workingUrl = new HttpURL(httpURL.getHost(), httpURL.getPort(), "/");
         while (responses.hasMoreElements()) {
 
             ResponseEntity response =
                 (ResponseEntity) responses.nextElement();
 
             boolean itself = false;
-            String href = response.getHref();
-            if (!href.startsWith("/"))
-                href = HttpURL.getEscapedPath(href);
+            workingUrl.setPath(response.getHref());
+            String href = workingUrl.getEscapedPath();
             String httpURLPath = httpURL.getEscapedPath();
             int compared = httpURLPath.compareTo(href);
             // Compare with the href path and requested-path itself.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to