org.mockserver.mappers
Class ContentTypeMapper

java.lang.Object
  extended by org.mockserver.mappers.ContentTypeMapper

public class ContentTypeMapper
extends Object

Author:
jamesdbloom

Field Summary
static Charset DEFAULT_HTTP_CHARACTER_SET
          The default character set for an HTTP message, if none is specified in the Content-Type header.
 
Constructor Summary
ContentTypeMapper()
           
 
Method Summary
static Charset determineCharsetForMessage(io.netty.handler.codec.http.HttpMessage httpMessage)
           
static Charset determineCharsetForMessage(HttpRequest httpRequest)
           
static Charset determineCharsetForMessage(HttpResponse httpResponse)
           
static Charset determineCharsetForMessage(javax.servlet.http.HttpServletRequest servletRequest)
           
static boolean isBinary(String contentTypeHeader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HTTP_CHARACTER_SET

public static final Charset DEFAULT_HTTP_CHARACTER_SET
The default character set for an HTTP message, if none is specified in the Content-Type header. From the HTTP 1.1 specification section 3.7.1 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1):
     The "charset" parameter is used with some media types to define the character set (section 3.4) of the data.
     When no explicit charset parameter is provided by the sender, media subtypes of the "text" type are defined to
     have a default charset value of "ISO-8859-1" when received via HTTP. Data in character sets other than
     "ISO-8859-1" or its subsets MUST be labeled with an appropriate charset value.
 

Constructor Detail

ContentTypeMapper

public ContentTypeMapper()
Method Detail

isBinary

public static boolean isBinary(String contentTypeHeader)

determineCharsetForMessage

public static Charset determineCharsetForMessage(io.netty.handler.codec.http.HttpMessage httpMessage)

determineCharsetForMessage

public static Charset determineCharsetForMessage(javax.servlet.http.HttpServletRequest servletRequest)

determineCharsetForMessage

public static Charset determineCharsetForMessage(HttpResponse httpResponse)

determineCharsetForMessage

public static Charset determineCharsetForMessage(HttpRequest httpRequest)


Copyright © 2017. All rights reserved.