catch (ItemNotFoundException e) {
// if it is thrown by super.doRetrieveItem()
List<String> transformedPaths = transformShadow2Master(request.getRequestPath());
if (transformedPaths == null || transformedPaths.isEmpty()) {
throw new ItemNotFoundException(reasonFor(request, this,
"Request path %s is not transformable to master.", request.getRequestPath()));
}
for (String transformedPath : transformedPaths) {
// delegate the call to the master
request.pushRequestPath(transformedPath);
try {
result = doRetrieveItemFromMaster(request);
// try to create link on the fly
try {
StorageLinkItem link = createLink(result);
if (link != null) {
return link;
}
else {
// fallback to result, but will not happen, see above
return result;
}
}
catch (Exception e1) {
// fallback to result, but will not happen, see above
return result;
}
}
catch (ItemNotFoundException ex) {
// neglect, we might try another transformed path
}
finally {
request.popRequestPath();
}
}
throw new ItemNotFoundException(request, this);
}
}