} catch (IOException e) {
// should not occure....
}
if (getDisplayName() != null) {
properties.add(new DefaultDavProperty(DavPropertyName.DISPLAYNAME, getDisplayName()));
}
if (isCollection()) {
properties.add(new ResourceType(ResourceType.COLLECTION));
// Windows XP support
properties.add(new DefaultDavProperty(DavPropertyName.ISCOLLECTION, "1"));
} else {
properties.add(new ResourceType(ResourceType.DEFAULT_RESOURCE));
// Windows XP support
properties.add(new DefaultDavProperty(DavPropertyName.ISCOLLECTION, "0"));
}
/* set current lock information. If no lock is set to this resource,
an empty lockdiscovery will be returned in the response. */
properties.add(new LockDiscovery(getLock(Type.WRITE, Scope.EXCLUSIVE)));
/* lock support information: all locks are lockable. */
SupportedLock supportedLock = new SupportedLock();
supportedLock.addEntry(Type.WRITE, Scope.EXCLUSIVE);
properties.add(supportedLock);
// non-protected JCR properties defined on the underlying jcr node
try {
PropertyIterator it = node.getProperties();
while (it.hasNext()) {
Property p = it.nextProperty();
String pName = p.getName();
PropertyDefinition def = p.getDefinition();
if (def.isMultiple() || isFilteredItem(p)) {
log.debug("Property '" + pName + "' not added to webdav property set (either multivalue or filtered).");
continue;
}
DavPropertyName name = getDavName(pName, node.getSession());
String value = p.getValue().getString();
properties.add(new DefaultDavProperty(name, value, def.isProtected()));
}
} catch (RepositoryException e) {
log.error("Unexpected error while retrieving properties: " + e.getMessage());
}
inited = true;