I'm also using the 1.0.9 client but there isn't any difference I think,
here is the relevant part of the code.
The cvs version has the following line
Enumeration enum = method.getResponseProperties(href);
and my fix was to change it to
Enumeration enum = method.getResponseProperties(path);
In my last mail you can see that href (http://localhost:8080/slide/files/a)
isn't in the response but path (/slide/files/a) is.
<response><href>/slide/files/a</href> <propstat><prop><a>aea</a> </p
rop> <status>HTTP/1.1 200 OK</status> </propstat> </response>
I looked at the spec and I think both formats are valid.
It's just strange that the Slide Server is sending relative path and the
client is expecting absolute URIs.
So my patch isn't correct, is just makes the slide server work.
And the spec doesn't say you cannot use .. in the URI so that href search
algorithm will become
a little more complex than a simple lookup :-)
Dirk
============================================================
[RFC2518] 12.3 href XML Element
Name: href
Namespace: DAV:
Purpose: Identifies the content of the element as a URI.
Value: URI ; See section 3.2.1 of [RFC2068]
<!ELEMENT href (#PCDATA)>
[RFC2068] 3.2.1 General Syntax
URIs in HTTP can be represented in absolute form or relative to some known
base URI, depending upon the context of their use. The two forms are
differentiated by the fact that absolute URIs always begin with a scheme
name followed by a colon.
============================================================
public Enumeration propfindMethod(String path, Vector properties)
throws WebdavException, IOException {
System.out.println("propfindMethod");
WebdavClient client =
WebdavSession.getSessionInstance(this.httpUrl);
// Check the path alright.
path = HttpURL.getPath(path);
// Default depth=1, type=by_name
PropFindMethod method = new PropFindMethod(path,
properties.elements());
client.executeMethod(method);
// Actually, the multi-status status code has the first priority.
setStatusCode(method.getStatusCode());
// It contains the results.
Vector results = new Vector();
HttpURL httpUrl = new HttpURL(this.httpUrl.getAuthority() + path);
String href = httpUrl.toURL().toString();
System.out.println("responses:");
Enumeration e = method.getResponses();
while ( e.hasMoreElements() )
{
ResponseEntity response=(ResponseEntity)
e.nextElement();
System.out.println(response.toString());
}
System.out.println("");
System.out.println("href: " + href);
System.out.println("path: " + path);
Enumeration enum = method.getResponseProperties(path);
while (enum.hasMoreElements()) {
Property property = (Property) enum.nextElement();
System.out.println("property: " + property);
if (property.getStatusCode() > 0) {
// Set the right status code by multi-status.
setStatusCode(property.getStatusCode());
}
// Do loop as many as requested.
for (int i = 0; i < properties.size(); i++) {
// Do not need to be more strict.
results.addElement(DOMUtils.getTextValue(property.getElement()));
}
}
// FIXME: some work is still needed. if null? server problem?
return results.elements();
}