private String getLocation(String context, Collection col, String resource) {
return context + col.getCanonicalDocumentName(resource);
}
public void addPropfindResponse(DAVResponse res, String location, HashMap statusList) throws IOException {
PartialResponse response = new PartialResponse(location);
for (Iterator i = statusList.keySet().iterator(); i.hasNext(); ) {
Integer status = (Integer) i.next();
ArrayList props = (ArrayList) statusList.get(status);
if (props != null && props.size() > 0) {
PartialResponse.Content prop = new PartialResponse.Content("prop");
for (Iterator j = props.iterator(); j.hasNext(); ) {
prop.addChild((PartialResponse.Content) j.next());
}
PartialResponse.Content stat = new PartialResponse.Content("status");
stat.setValue(res.getProtocol() + " " + status + " " + WebdavStatus.getStatusText(status.intValue()));
PartialResponse.Content propstat = new PartialResponse.Content("propstat");
propstat.addChild(prop);
propstat.addChild(stat);
response.addContent(propstat);
}
}
res.sendMultiStatusResponse(response);
}