if (workspace == null) return null;
PathNode node = null;
if (location.getUuid() != null) {
if (repository.getRootNodeUuid().equals(location.getUuid())) {
PathFactory pathFactory = new ExecutionContext().getValueFactories().getPathFactory();
return workspace.getNode(pathFactory.createRootPath());
}
}
if (!location.hasPath()) {
I18n msg = GraphI18n.pathConnectorRequestsMustHavePath;
request.setError(new IllegalArgumentException(msg.text()));
return null;
}
// Look up the node with the supplied path ...
Path path = location.getPath();
if (path != null) {
node = workspace.getNode(path);
}
if (node == null && request != null) {
if (path == null) {
// Missing path, and could not find by UUID ...
request.setError(new PathNotFoundException(location, pathFactory.createRootPath(),
GraphI18n.nodeDoesNotExist.text(path)));
return null;
}
// Could not find the node given the supplied path, so find the lowest path that does exist ...
Path lowestExisting = workspace.getLowestExistingPath(path);