if (entity == null) {//wrong resource
String errorMessage = localStrings.getLocalString("rest.resource.erromessage.noentity",
"Resource not found.");
return ResourceUtil.getActionReportResult(ActionReport.ExitCode.FAILURE, errorMessage, requestHeaders, uriInfo);
}
RestActionReporter ar = new RestActionReporter();
final String typeKey = (decode(getName(uriInfo.getPath(), '/')));
ar.setActionDescription(typeKey);
OptionsResult optionsResult = new OptionsResult(Util.getResourceName(uriInfo));
Map<String, MethodMetaData> mmd = getMethodMetaData();
optionsResult.putMethodMetaData("GET", mmd.get("GET"));
optionsResult.putMethodMetaData("POST", mmd.get("POST"));
ResourceUtil.addMethodMetaData(ar, mmd);
ar.getExtraProperties().put("childResources", ResourceUtil.getResourceLinks(getEntity(), uriInfo));
ar.getExtraProperties().put("commands", ResourceUtil.getCommandLinks(getCommandResourcesPaths()));
// FIXME: I'd rather not keep using OptionsResult, but I don't have the time at this point to do it "right." This is
// an internal impl detail, so it can wait
return new ActionReportResult(ar, optionsResult);
}