if (node != null) {
return node;
}
// First need to check that the path is indeed valid.
NodeExistsCommand existCommand = new NodeExistsCommand(nodeStore,
path, baseRevisionId);
existCommand.setBranchId(branchId);
boolean exists = false;
try {
exists = existCommand.execute();
} catch (Exception ignore) {}
if (!exists) {
throw new NotFoundException(path + " @rev" + baseRevisionId);
}
node = existCommand.getNode();
node.removeField("_id");
if (addToMap) {
pathNodeMap.put(path, node);
}
return node;