Class ContentNegotiator

java.lang.Object
org.apache.olingo.odata2.core.ContentNegotiator

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

    • ContentNegotiator

      public ContentNegotiator()
  • Method Details

    • 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:
      request - 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