public final CRResolvableBean getObject(final CRRequest request) {
CRResolvableBean contentObject = null;
String url = request.getUrl();
if (url != null) {
CRRequest r = new CRRequest();
PathBean pb = new PathBean(request.getUrl());
String path = pb.getPath();
String filter = "";
if (path == null || "".equals(path)) {
filter = "(pub_dir:(/)) AND filename:(" + pb.getFilename() + ")";
} else {
filter = "(pub_dir:(" + pb.getPath() + ") OR pub_dir:(" + pb.getPath() + "/)) AND filename:("
+ pb.getFilename() + ")";
}
log.debug("Using filter: " + filter);
r.setRequestFilter(filter);
try {
contentObject = rp.getFirstMatchingResolvable(r);
} catch (CRException e) {
log.error("Could not load object from path " + url, e);
}