@Override public Response apply(ContainerRequestContext containerRequestContext) { Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods(extendedUriInfo.get() .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) { Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods(extendedUriInfo.get() .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.get().getMatchedRuntimeResources().get(0))); return Response.ok() .allow(allowedMethods) .header(HttpHeaders.CONTENT_LENGTH, "0") .type(containerRequestContext.getAcceptableMediaTypes().get(0)) .build(); } }
@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(); } }
/** * Construct a new method not allowed exception. * * @param cause the underlying cause of the exception. * @param allowedMethods allowed request methods. * @throws IllegalArgumentException in case the allowed methods varargs are {@code null}. */ public NotAllowedException(Throwable cause, String... allowedMethods) { super(validateAllow(Response.status(Response.Status.METHOD_NOT_ALLOWED).allow(allowedMethods).build()), cause); }
/** * Construct a new method not allowed exception. * * @param cause the underlying cause of the exception. * @param allowedMethods allowed request methods. * @throws IllegalArgumentException in case the allowed methods varargs are {@code null}. */ public NotAllowedException(Throwable cause, String... allowedMethods) { super(validateAllow(Response.status(Response.Status.METHOD_NOT_ALLOWED).allow(allowedMethods).build()), cause); }
@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 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(); } }
/** * Construct a new method not allowed exception. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the underlying cause of the exception. * @param allowedMethods allowed request methods. * @throws IllegalArgumentException in case the allowed methods varargs are {@code null}. */ public NotAllowedException(String message, Throwable cause, String... allowedMethods) { super(message, validateAllow(Response.status(Response.Status.METHOD_NOT_ALLOWED).allow(allowedMethods).build()), cause); }
@Override public Response apply(ContainerRequestContext containerRequestContext) { Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods(extendedUriInfo.get() .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(); } }
/** * Construct a new method not allowed exception. * * @param message the detail message (which is saved for later retrieval * by the {@link #getMessage()} method). * @param cause the underlying cause of the exception. * @param allowedMethods allowed request methods. * @throws IllegalArgumentException in case the allowed methods varargs are {@code null}. */ public NotAllowedException(String message, Throwable cause, String... allowedMethods) { super(message, validateAllow(Response.status(Response.Status.METHOD_NOT_ALLOWED).allow(allowedMethods).build()), cause); }
if (acceptors == null) { throw new NotAllowedException( Response.status(Status.METHOD_NOT_ALLOWED).allow(consumesProducesAcceptors.keySet()).build());
.allow(ModelProcessorUtil.getAllowedMethods(resource)) .header("Last-modified", lastModified) .entity(bytes)
@Override public Response apply(ContainerRequestContext containerRequestContext) { final Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods( (extendedUriInfo.get().getMatchedRuntimeResources().get(0))); return Response.ok() .allow(allowedMethods) .header(HttpHeaders.CONTENT_LENGTH, "0") .type(containerRequestContext.getAcceptableMediaTypes().get(0)) .build(); } }
@Override public Response apply(ContainerRequestContext containerRequestContext) { Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods(extendedUriInfo.get() .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(); } }
if (acceptors == null) { throw new NotAllowedException( Response.status(Status.METHOD_NOT_ALLOWED).allow(consumesProducesAcceptors.keySet()).build());
if (acceptors == null) { throw new NotAllowedException( Response.status(Status.METHOD_NOT_ALLOWED).allow(consumesProducesAcceptors.keySet()).build());
.allow(ModelProcessorUtil.getAllowedMethods(resource)) .header("Last-modified", lastModified) .entity(bytes)
.allow(ModelProcessorUtil.getAllowedMethods(resource)) .header("Last-modified", lastModified) .entity(bytes)
@Override public Response apply(ContainerRequestContext containerRequestContext) { final Set<String> allowedMethods = ModelProcessorUtil.getAllowedMethods( (extendedUriInfo.get().getMatchedRuntimeResources().get(0))); return Response.ok() .allow(allowedMethods) .header(HttpHeaders.CONTENT_LENGTH, "0") .type(containerRequestContext.getAcceptableMediaTypes().get(0)) .build(); } }