@Override public Response apply(ContainerRequestContext containerRequestContext) { Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods(extendedUriInfo.getMatchedRuntimeResources().get(0)); final String allowedList = allowedMethods.toString(); final String optionsBody = allowedList.substring(1, allowedList.length() - 1); return Response.ok(optionsBody, MediaType.TEXT_PLAIN_TYPE).allow(allowedMethods).build(); }
@Override public Response apply(ContainerRequestContext containerRequestContext) { final Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods( (extendedUriInfo.getMatchedRuntimeResources().get(0))); return Response.ok() .allow(allowedMethods) .header(HttpHeaders.CONTENT_LENGTH, "0") .type(containerRequestContext.getAcceptableMediaTypes().get(0)) .build(); }
@Override public ResourceModel processSubResource( ResourceModel subResourceModel, Configuration configuration) { return ModelProcessorUtil.enhanceResourceModel(subResourceModel, true, methodList).build(); }
@Override public ResourceModel processResourceModel( ResourceModel resourceModel, Configuration configuration) { return ModelProcessorUtil.enhanceResourceModel(resourceModel, false, methodList).build(); }