public Enumeration propfindMethod(String path, Vector properties)
throws HttpException, IOException {
setClient();
// Default depth=0, type=by_name
PropFindMethod method = new PropFindMethod(URIUtil.encodePath(path),
DepthSupport.DEPTH_0,
properties.elements());
int status = client.executeMethod(method);
// Also accept OK sent by buggy servers.
if (status != HttpStatus.SC_MULTI_STATUS
&& status != HttpStatus.SC_OK) {
HttpException ex = new HttpException();
ex.setReasonCode(status);
throw ex;
}
// It contains the results.
Vector results = new Vector();
Enumeration responses = method.getResponses();
if (responses.hasMoreElements()) {
ResponseEntity response =
(ResponseEntity) responses.nextElement();
String href = response.getHref();
// Set status code for this resource.
if ((thisResource == true) && (response.getStatusCode() > 0))
setStatusCode(response.getStatusCode());
thisResource = false;
Enumeration responseProperties =
method.getResponseProperties(href);
while (responseProperties.hasMoreElements()) {
Property property =
(Property) responseProperties.nextElement();
results.addElement(property.getPropertyAsString());
}