sanityCheck();
Path p = resolveRelativePath(relPath);
NodeId id = getNodeId(p);
if (id == null) {
throw new PathNotFoundException(relPath);
}
// determine parent as mandated by path
NodeId parentId = null;
if (!p.denotesRoot()) {
parentId = getNodeId(p.getAncestor(1));
}
try {
if (parentId == null) {
return (NodeImpl) itemMgr.getItem(id);
}
// if the node is shareable, it now returns the node with the right
// parent
return itemMgr.getNode(id, parentId);
} catch (AccessDeniedException ade) {
throw new PathNotFoundException(relPath);
} catch (ItemNotFoundException infe) {
throw new PathNotFoundException(relPath);
}
}