コード例 #1
0
    @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();
    }
コード例 #2
0
 @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();
 }
コード例 #3
0
 @Override
 public ResourceModel processSubResource(
     ResourceModel subResourceModel, Configuration configuration) {
   return ModelProcessorUtil.enhanceResourceModel(subResourceModel, true, methodList).build();
 }
コード例 #4
0
 @Override
 public ResourceModel processResourceModel(
     ResourceModel resourceModel, Configuration configuration) {
   return ModelProcessorUtil.enhanceResourceModel(resourceModel, false, methodList).build();
 }