CachedNode parent ) {
if (parent != null) {
ChildReference ref = parent.getChildReferences(cache).getChild(key, new BasicContext());
if (ref == null) {
// This node doesn't exist in the parent
throw new NodeNotFoundInParentException(key, parent.getKey());
}
return ref.getSegment();
}
// This is the root node ...
return workspace(cache).childReferenceForRoot().getSegment();