Examples of NotAcceptableException


Examples of javax.ws.rs.NotAcceptableException

            org.w3c.dom.Document domDoc = convertToDOM(doc);

            MessageBodyWriter<org.w3c.dom.Document> writer =
                providers.getMessageBodyWriter(DOM_DOC_CLS, DOM_DOC_CLS, anns, mt);
            if (writer == null) {
                throw new NotAcceptableException();
            }
            writer.writeTo(domDoc, DOM_DOC_CLS, DOM_DOC_CLS, anns, mt, headers, os);
        }
    }
View Full Code Here

Examples of net.fortytwo.twitlogic.services.twitter.errors.NotAcceptableException

                        throw new ForbiddenException();
                    case 404:
                        throw new NotFoundException();
                    case 406:
                        showRequestInfo(request);
                        throw new NotAcceptableException();
                    case 420:
                        throw new EnhanceYourCalmException();
                    case 500:
                        throw new InternalServerErrorException();
                    case 502:
View Full Code Here

Examples of org.cruxframework.crux.core.server.rest.spi.NotAcceptableException

    // MediaType contentType = request.getHttpHeaders().getMediaType();
    List<MediaType> accepts = request.getHttpHeaders().getAcceptableMediaTypes();

    if (!isResponseMediaTypeAllowed(accepts))
    {
      throw new NotAcceptableException("No match for accept header");
    }

    ResourceMethod invoker = null;

    for (ResourceMethod rm : methods)
View Full Code Here

Examples of org.jboss.resteasy.spi.NotAcceptableException

         }
         else if (!consumeMatch)
         {
            throw new UnsupportedMediaTypeException("Cannot consume content type");
         }
         throw new NotAcceptableException("No match for accept header");
      }
      if (list.size() == 1) return list.get(0);

      // Populate the consumes identity map with media types from each ResourceMethod
      // so that we can easily pick invokers after media types are sorted
View Full Code Here

Examples of org.jboss.resteasy.spi.NotAcceptableException

         }
         else if (!consumeMatch)
         {
            throw new UnsupportedMediaTypeException("Cannot consume content type");
         }
         throw new NotAcceptableException("No match for accept header");
      }
      if (list.size() == 1) return list.get(0);

      list = new ArrayList<ResourceMethod>();
      ArrayList<WeightedMediaType> consumes = new ArrayList<WeightedMediaType>();
View Full Code Here

Examples of org.jboss.resteasy.spi.NotAcceptableException

*/
public class NotAcceptableExceptionMapperTest extends TestExceptionMapperBase {

    @Test
    public void handleNotAcceptableException() {
        NotAcceptableException nae = new NotAcceptableException("unacceptable");
        NotAcceptableExceptionMapper naem =
            injector.getInstance(NotAcceptableExceptionMapper.class);
        Response r = naem.toResponse(nae);
        assertEquals(406, r.getStatus());
        verifyMessage(r, rtmsg("unacceptable"));
View Full Code Here

Examples of org.jboss.resteasy.spi.NotAcceptableException

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public Response logoutToken(final @HeaderParam(HttpHeaders.AUTHORIZATION) String authorizationHeader,
                                       final MultivaluedMap<String, String> form) {
        if (!checkSsl()) {
            throw new NotAcceptableException("HTTPS required");
        }

        event.event(EventType.LOGOUT);

        ClientModel client = authorizeClient(authorizationHeader, form, event);
View Full Code Here

Examples of org.jboss.resteasy.spi.NotAcceptableException

    @Produces(MediaType.APPLICATION_OCTET_STREAM)
    @Consumes(MediaType.APPLICATION_JSON)
    public byte[] getKeystore(final KeyStoreConfig config) {
        auth.requireView();
        if (config.getFormat() != null && !config.getFormat().equals("JKS") && !config.getFormat().equals("PKCS12")) {
            throw new NotAcceptableException("Only support jks format.");
        }
        String format = config.getFormat();
        String privatePem = client.getAttribute(privateAttribute);
        String certPem = client.getAttribute(certificateAttribute);
        if (privatePem == null && certPem == null) {
View Full Code Here

Examples of org.jivesoftware.openfire.muc.NotAcceptableException

                }
            }
            if (isLoginRestrictedToNickname()) {
                String reservedNickname = members.get(user.getAddress().toBareJID());
                if (reservedNickname != null && !nickname.equals(reservedNickname)) {
                    throw new NotAcceptableException();
                }
            }

            // Set the corresponding role based on the user's affiliation
            MUCRole.Role role;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.