Class ContentNegotiator


  • public class ContentNegotiator
    extends Object
    Handles content negotiation with handling of OData special cases.
    • Constructor Detail

      • ContentNegotiator

        public ContentNegotiator()
    • Method Detail

      • doContentNegotiation

        public ContentType doContentNegotiation​(ODataRequest odataRequest,
                                                UriInfoImpl uriInfo,
                                                List<String> supportedContentTypes)
                                         throws ODataException
        Do the content negotiation for accept header value based on requested content type (in HTTP accept header from ODataRequest) in combination with uri information from UriInfo and from given supported content types (via supportedContentTypes).
        Parameters:
        odataRequest - specific request
        uriInfo - specific uri information
        supportedContentTypes - list of supported content types
        Returns:
        best fitting content type or NULL if content type is not set and for given UriInfo is ignored
        Throws:
        ODataException - if no supported content type was found
        IllegalArgumentException - if one of the input parameter is NULL