*/
public boolean proppatchMethod(String path, Hashtable properties,
boolean action) throws HttpException, IOException {
setClient();
PropPatchMethod method = new PropPatchMethod(URIUtil.encodePath(path));
generateIfHeader(method);
Enumeration names = properties.keys();
boolean hasSomething = false;
if (names.hasMoreElements()) {
hasSomething = true;
}
while (names.hasMoreElements()) {
Object item = names.nextElement();
if (item instanceof String) {
String name = (String) item;
String value = (String) properties.get(item);
if (action) {
method.addPropertyToSet(name, value);
} else {
method.addPropertyToRemove(name);
}
} else if (item instanceof PropertyName) {
String name = ((PropertyName) item).getLocalName();
String namespaceURI = ((PropertyName) item).getNamespaceURI();
String value = (String) properties.get(item);
if (action) {
method.addPropertyToSet(name, value, null, namespaceURI);
} else {
method.addPropertyToRemove(name, null, namespaceURI);
}
} else {
// unknown type, debug or ignore it
}
}