*/
public DavResource createResource(DavResourceLocator locator, DavSession session) throws DavException {
JcrDavSession.checkImplementation(session);
JcrDavSession sessionImpl = (JcrDavSession)session;
DavResource resource;
if (locator.isRootLocation()) {
resource = new RootCollection(locator, sessionImpl, this);
} else if (locator.getResourcePath().equals(locator.getWorkspacePath())) {
resource = new WorkspaceResourceImpl(locator, sessionImpl, this);
} else {
try {
resource = createResourceForItem(locator, sessionImpl);
} catch (RepositoryException e) {
log.debug("Creating resource for non-existing repository item: " + locator.getRepositoryPath());
// todo: is this correct?
resource = new VersionControlledItemCollection(locator, sessionImpl, this, null);
}
}
// todo: currently transactionId is set manually after creation > to be improved.
resource.addLockManager(txMgr);
if (resource instanceof ObservationResource) {
((ObservationResource)resource).init(subsMgr);
}
return resource;
}