segment = segmentFrom(relativePath);
}
assert !segment.isIdentifier();
// It's just a name, so look for a child ...
ChildReference ref = node().getChildReferences(sessionCache()).getChild(segment);
if (ref == null) {
String msg = JcrI18n.childNotFoundUnderNode.text(readable(segment), location(), session.workspaceName());
throw new PathNotFoundException(msg);
}
try {
AbstractJcrNode node = session().node(ref.getKey(), null, key());
session().checkPermission(node, ModeShapePermissions.READ);
return node;
} catch (ItemNotFoundException e) {
// expected by TCK
String msg = JcrI18n.pathNotFoundRelativeTo.text(relativePath, location(), workspaceName());