Package org.jboss.resteasy.spi

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


         }
         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

*/
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

    @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

    @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

TOP

Related Classes of org.jboss.resteasy.spi.NotAcceptableException

Copyright © 2018 www.massapicom. 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.