Path lowestExistingInFederated = pathFactory.createRootPath();
while (projected != null) {
Request projectedRequest = projected.getRequest();
Throwable error = projectedRequest.getError();
if (error instanceof PathNotFoundException) {
PathNotFoundException notFound = (PathNotFoundException)error;
Path lowestExisting = notFound.getLowestAncestorThatDoesExist();
// Project back to the repository level ...
for (Path federatedPath : projected.getProjection().getPathsInRepository(lowestExisting, pathFactory)) {
if (federatedPath.isAtOrBelow(lowestExistingInFederated)) {
lowestExistingInFederated = federatedPath;
}
}
}
projected = projected.next();
}
original.setError(new PathNotFoundException(originalLocation, lowestExistingInFederated));
}