throw new RepositoryException("Internal error: ambigous item definition found '" + saveGetIdString(itemId, sessionInfo) + "'.");
}
DavPropertySet propertySet = responses[0].getProperties(DavServletResponse.SC_OK);
// check if definition matches the type of the id
DavProperty rType = propertySet.get(DavPropertyName.RESOURCETYPE);
if (rType.getValue() == null && itemId.denotesNode()) {
throw new RepositoryException("Internal error: requested node definition and got property definition.");
}
NamePathResolver resolver = getNamePathResolver(sessionInfo);
// build the definition
QItemDefinition definition = null;
if (propertySet.contains(ItemResourceConstants.JCR_DEFINITION)) {
DavProperty prop = propertySet.get(ItemResourceConstants.JCR_DEFINITION);
Object value = prop.getValue();
if (value != null && value instanceof Element) {
Element idfElem = (Element) value;
if (itemId.denotesNode()) {
definition = new QNodeDefinitionImpl(null, idfElem, resolver);
} else {