Examples of NotAcceptableException


Examples of com.google.gdata.util.NotAcceptableException

      case HttpURLConnection.HTTP_ENTITY_TOO_LARGE:
        throw new EntityTooLargeException(httpConn);

      case HttpURLConnection.HTTP_NOT_ACCEPTABLE:
        throw new NotAcceptableException(httpConn);

      case HttpURLConnection.HTTP_GONE:
        throw new NoLongerAvailableException(httpConn);

      default:
View Full Code Here

Examples of com.google.gdata.util.NotAcceptableException

      case HttpURLConnection.HTTP_ENTITY_TOO_LARGE:
        throw new EntityTooLargeException(httpConn);

      case HttpURLConnection.HTTP_NOT_ACCEPTABLE:
        throw new NotAcceptableException(httpConn);

      case HttpURLConnection.HTTP_GONE:
        throw new NoLongerAvailableException(httpConn);

      default:
View Full Code Here

Examples of com.google.gdata.util.NotAcceptableException

      case HttpURLConnection.HTTP_ENTITY_TOO_LARGE:
        throw new EntityTooLargeException(httpConn);

      case HttpURLConnection.HTTP_NOT_ACCEPTABLE:
        throw new NotAcceptableException(httpConn);

      case HttpURLConnection.HTTP_GONE:
        throw new NoLongerAvailableException(httpConn);

      default:
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

        return new NotAuthorizedException(checkResponse(response, 401), cause);
    }
       
    public static NotAcceptableException toNotAcceptableException(Throwable cause, Response response) {
       
        return new NotAcceptableException(checkResponse(response, 406), cause);
    }
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

        return new ForbiddenException(checkResponse(response, 403), cause);
    }
   
    public static NotAcceptableException toNotAcceptableException(Throwable cause, Response response) {
       
        return new NotAcceptableException(checkResponse(response, 406), cause);
    }
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

        }
        List<MediaType> acceptContentTypes = null;
        try {
            acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes, JAXRSUtils.MEDIA_TYPE_Q_PARAM);
        } catch (IllegalArgumentException ex) {
            throw new NotAcceptableException();
        }
        message.getExchange().put(Message.ACCEPT_CONTENT_TYPE, acceptContentTypes);

        MultivaluedMap<String, String> values = new MetadataMap<String, String>();
        ClassResourceInfo resource = JAXRSUtils.selectResourceClass(resources,
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

        }
        List<MediaType> acceptContentTypes = null;
        try {
            acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes, JAXRSUtils.MEDIA_TYPE_Q_PARAM);
        } catch (IllegalArgumentException ex) {
            throw new NotAcceptableException();
        }
        message.getExchange().put(Message.ACCEPT_CONTENT_TYPE, acceptContentTypes);

        MultivaluedMap<String, String> values = new MetadataMap<String, String>();
        ClassResourceInfo resource = JAXRSUtils.selectResourceClass(resources,
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

                        if (isWildcard(effectiveResponseType)) {
                            if (effectiveResponseType.isWildcardType()
                                    || "application".equalsIgnoreCase(effectiveResponseType.getType())) {
                                effectiveResponseType = MediaType.APPLICATION_OCTET_STREAM_TYPE;
                            } else {
                                throw new NotAcceptableException();
                            }
                        }
                        responseContext.setMediaType(effectiveResponseType);
                    }

                    return responseContext;
                }
            });
            return selected.methodAcceptorPair.router;
        }

        throw new NotAcceptableException();
    }
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

            // (if there are any left)
            if (anyRemaining && !acceptedEncodings.isEmpty()) {
                contentEncoding = acceptedEncodings.first();
            } else {
                // no acceptable encoding can be sent -> return NOT ACCEPTABLE status code back to the client
                throw new NotAcceptableException();
            }
        }

        // finally set the header - but no need to set for identity encoding
        if (!IDENTITY_ENCODING.equals(contentEncoding)) {
View Full Code Here

Examples of javax.ws.rs.NotAcceptableException

                    break;
                case METHOD_NOT_ALLOWED:
                    webAppException = new NotAllowedException(response);
                    break;
                case NOT_ACCEPTABLE:
                    webAppException = new NotAcceptableException(response);
                    break;
                case UNSUPPORTED_MEDIA_TYPE:
                    webAppException = new NotSupportedException(response);
                    break;
                case INTERNAL_SERVER_ERROR:
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.