Class ResteasyHttpHeaders

java.lang.Object
org.jboss.resteasy.specimpl.ResteasyHttpHeaders
All Implemented Interfaces:
HttpHeaders

public class ResteasyHttpHeaders extends Object implements HttpHeaders
Version:
$Revision: 1 $
Author:
Bill Burke
  • Constructor Details

  • Method Details

    • getRequestHeaders

      public MultivaluedMap<String,String> getRequestHeaders()
      Description copied from interface: HttpHeaders
      Get the values of HTTP request headers. The returned Map is case-insensitive wrt. keys and is read-only. The method never returns null.
      Specified by:
      getRequestHeaders in interface HttpHeaders
      Returns:
      a read-only map of header names and values.
    • getMutableHeaders

      public MultivaluedMap<String,String> getMutableHeaders()
    • testParsing

      public void testParsing()
    • getRequestHeader

      public List<String> getRequestHeader(String name)
      Description copied from interface: HttpHeaders
      Get the values of a HTTP request header if the header exists on the current request. The returned value will be a read-only List if the specified header exists or null if it does not. This is a shortcut for getRequestHeaders().get(name).
      Specified by:
      getRequestHeader in interface HttpHeaders
      Parameters:
      name - the header name, case insensitive.
      Returns:
      a read-only list of header values if the specified header exists, otherwise null.
    • getCookies

      public Map<String,Cookie> getCookies()
      Description copied from interface: HttpHeaders
      Get any cookies that accompanied the request.
      Specified by:
      getCookies in interface HttpHeaders
      Returns:
      a read-only map of cookie name (String) to Cookie.
    • getMutableCookies

      public Map<String,Cookie> getMutableCookies()
    • setCookies

      public void setCookies(Map<String,Cookie> cookies)
    • getDate

      public Date getDate()
      Description copied from interface: HttpHeaders
      Get message date.
      Specified by:
      getDate in interface HttpHeaders
      Returns:
      the message date, otherwise null if not present.
    • getHeaderString

      public String getHeaderString(String name)
      Description copied from interface: HttpHeaders

      Get a HTTP header as a single string value.

      Each single header value is converted to String using a RuntimeDelegate.HeaderDelegate if one is available via RuntimeDelegate.createHeaderDelegate(java.lang.Class) for the header value class or using its toString method if a header delegate is not available.
      Specified by:
      getHeaderString in interface HttpHeaders
      Parameters:
      name - the HTTP header.
      Returns:
      the HTTP header value. If the HTTP header is not present then null is returned. If the HTTP header is present but has no value then the empty string is returned. If the HTTP header is present more than once then the values of joined together and separated by a ',' character.
      See Also:
    • getLanguage

      public Locale getLanguage()
      Description copied from interface: HttpHeaders
      Get the language of the request entity.
      Specified by:
      getLanguage in interface HttpHeaders
      Returns:
      the language of the entity or null if not specified.
    • getLength

      public int getLength()
      Description copied from interface: HttpHeaders
      Get Content-Length value.
      Specified by:
      getLength in interface HttpHeaders
      Returns:
      Content-Length as integer if present and valid number. In other cases returns -1.
    • getMediaType

      public MediaType getMediaType()
      Description copied from interface: HttpHeaders
      Get the media type of the request entity.
      Specified by:
      getMediaType in interface HttpHeaders
      Returns:
      the media type or null if there is no request entity.
    • getAcceptableMediaTypes

      public List<MediaType> getAcceptableMediaTypes()
      Description copied from interface: HttpHeaders

      Get a list of media types that are acceptable for the response.

      If no acceptable media types are specified, a read-only list containing a single wildcard media type instance is returned.
      Specified by:
      getAcceptableMediaTypes in interface HttpHeaders
      Returns:
      a read-only list of requested response media types sorted according to their q-value, with highest preference first.
    • getAcceptableLanguages

      public List<Locale> getAcceptableLanguages()
      Description copied from interface: HttpHeaders

      Get a list of languages that are acceptable for the response.

      If no acceptable languages are specified, a read-only list containing a single wildcard Locale instance (with language field set to "*") is returned.
      Specified by:
      getAcceptableLanguages in interface HttpHeaders
      Returns:
      a read-only list of acceptable languages sorted according to their q-value, with highest preference first.