Package javax.ws.rs

Examples of javax.ws.rs.NotSupportedException


       
        MediaType requestType;
        try {
            requestType = getMethod ? MediaType.WILDCARD_TYPE : toMediaType(requestContentType);
        } catch (IllegalArgumentException ex) {
            throw new NotSupportedException(ex);
        }
       
        SortedMap<OperationResourceInfo, MultivaluedMap<String, String>> candidateList =
            new TreeMap<OperationResourceInfo, MultivaluedMap<String, String>>(
                new OperationResourceInfoComparator(message, httpMethod,
View Full Code Here


                    org.apache.cxf.common.i18n.Message errorMsg =
                        new org.apache.cxf.common.i18n.Message("WRONG_FORM_MEDIA_TYPE",
                                                               BUNDLE,
                                                               mt.toString());
                    LOG.warning(errorMsg.toString());
                    throw new NotSupportedException();
                }
            }
        }
       
        if ("".equals(key)) {
View Full Code Here

         case 405:
            throw new NotAllowedException(response);
         case 406:
            throw new NotAcceptableException(response);
         case 415:
            throw new NotSupportedException(response);
         case 500:
            throw new InternalServerErrorException(response);
         case 503:
            throw new ServiceUnavailableException(response);
         default:
View Full Code Here

               throw new NotAllowedException("No resource method found for " + httpMethod + ", return 405 with Allow header", res);
            }
         }
         else if (!consumeMatch)
         {
            throw new NotSupportedException("Cannot consume content type");
         }
         throw new NotAcceptableException("No match for accept header");
      }
      //if (list.size() == 1) return list.get(0); //don't do this optimization as we need to set chosen accept
      List<SortEntry> sortList = new ArrayList<SortEntry>();
View Full Code Here

   }

   @Override
   protected void throwReaderNotFound()
   {
      throw new NotSupportedException(
              "Could not find message body reader for type: "
                      + genericType + " of content type: " + mediaType);
   }
View Full Code Here

                    break;
                case NOT_ACCEPTABLE:
                    webAppException = new NotAcceptableException(response);
                    break;
                case UNSUPPORTED_MEDIA_TYPE:
                    webAppException = new NotSupportedException(response);
                    break;
                case INTERNAL_SERVER_ERROR:
                    webAppException = new InternalServerErrorException(response);
                    break;
                case SERVICE_UNAVAILABLE:
View Full Code Here

                    break;
                case NOT_ACCEPTABLE:
                    webAppException = new NotAcceptableException(response);
                    break;
                case UNSUPPORTED_MEDIA_TYPE:
                    webAppException = new NotSupportedException(response);
                    break;
                case INTERNAL_SERVER_ERROR:
                    webAppException = new InternalServerErrorException(response);
                    break;
                case SERVICE_UNAVAILABLE:
View Full Code Here

            if (cpi.isConsumable(requestContext)) {
                satisfyingAcceptors.add(cpi);
            }
        }
        if (satisfyingAcceptors.isEmpty()) {
            throw new NotSupportedException();
        }

        final List<MediaType> acceptableMediaTypes = requestContext.getAcceptableMediaTypes();
        final MethodSelector methodSelector = new MethodSelector(null);
View Full Code Here

                        MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os)
        throws IOException {
        if (MediaType.APPLICATION_JSON_TYPE.isCompatible(mt)) {
            Writer w = createWriter("json");
            if (w == null) {
                throw new NotSupportedException();
            }
            element.writeTo(w, os);  
        } else if (formattedOutput) {
            Writer w = createWriter("prettyxml");
            if (w != null) {
View Full Code Here

                    MultivaluedMap<String, String> headers, InputStream is)
        throws IOException, WebApplicationException {
        MessageBodyReader<org.w3c.dom.Document> reader =
            providers.getMessageBodyReader(DOM_DOC_CLS, DOM_DOC_CLS, anns, mt);
        if (reader == null) {
            throw new NotSupportedException();
        }
        org.w3c.dom.Document domDoc =
            reader.readFrom(DOM_DOC_CLS, DOM_DOC_CLS, anns, mt, headers, is);
        return new org.dom4j.io.DOMReader().read(domDoc);
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.NotSupportedException

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.