use of org.apache.jackrabbit.webdav.bind.ParentSet in project jackrabbit by apache.
the class DavResourceImpl method initProperties.
/**
* Fill the set of properties
*/
protected void initProperties() {
if (!exists() || propsInitialized) {
return;
}
try {
config.getPropertyManager().exportProperties(getPropertyExportContext(), isCollection());
} catch (RepositoryException e) {
log.warn("Error while accessing resource properties", e);
}
// set (or reset) fundamental properties
if (getDisplayName() != null) {
properties.add(new DefaultDavProperty<String>(DavPropertyName.DISPLAYNAME, getDisplayName()));
}
if (isCollection()) {
properties.add(new ResourceType(ResourceType.COLLECTION));
// Windows XP support
properties.add(new DefaultDavProperty<String>(DavPropertyName.ISCOLLECTION, "1"));
} else {
properties.add(new ResourceType(ResourceType.DEFAULT_RESOURCE));
// Windows XP support
properties.add(new DefaultDavProperty<String>(DavPropertyName.ISCOLLECTION, "0"));
}
if (rfc4122Uri != null) {
properties.add(new HrefProperty(BindConstants.RESOURCEID, rfc4122Uri, true));
}
Set<ParentElement> parentElements = getParentElements();
if (!parentElements.isEmpty()) {
properties.add(new ParentSet(parentElements));
}
/* set current lock information. If no lock is set to this resource,
an empty lock discovery 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);
propsInitialized = true;
}
Aggregations