convertTypesToString(ori.getProduceTypes()));
LOG.fine(errorMsg.toString());
}
public static ResponseBuilder createResponseBuilder(ClassResourceInfo cri, int status, boolean addAllow) {
ResponseBuilder rb = Response.status(status);
if (addAllow) {
Set<String> allowedMethods = cri.getAllowedMethods();
for (String m : allowedMethods) {
rb.header("Allow", m);
}
// "OPTIONS" are supported all the time really
if (!allowedMethods.contains("OPTIONS")) {
rb.header("Allow", "OPTIONS");
}
if (!allowedMethods.contains("HEAD") && allowedMethods.contains("GET")) {
rb.header("Allow", "HEAD");
}
}
return rb;
}