Class ContentType


  • public class ContentType
    extends ParameterizedArgument
    This class handles the HTTP Content-Type header field. See: RFC HTTP/1.1 RFC2616 14.1 Content-Type
    • Field Detail

      • KEY_CHARSET

        public static final java.lang.String KEY_CHARSET
        The string "charset".
        See Also:
        Constant Field Values
    • Constructor Detail

      • ContentType

        public ContentType()
        Empty Constructor.
      • ContentType

        public ContentType​(java.lang.String mimeType)
        Constructor with MIME type parameter.
        Parameters:
        mimeType - the MIME type to use for content type
      • ContentType

        public ContentType​(java.lang.String mimeType,
                           java.lang.String charset)
        Constructor with MIME type and character set parameters.
        Parameters:
        mimeType - the MIME type to use as content type
        charset - the character set to use
    • Method Detail

      • endParse

        public void endParse()
        IS2T-API Canonises the MIME type.

        At the end of the parsing, converts the MIME type to lower case and interns it.

        Overrides:
        endParse in class CharacterSeparatedList
      • generate

        public java.lang.StringBuilder generate​(java.lang.StringBuilder sb)
        Appends the current character set to the StringBuffer sb in the following form: ;charset=<character-set-string>.
        Overrides:
        generate in class ParameterizedArgument
        Parameters:
        sb - the StringBuffer
        Returns:
        the StringBuffer sb.
      • getCharset

        @Nullable
        public java.lang.String getCharset()
        Returns the optional charset. Could be null.
        Returns:
        the optional charset.
      • getMIMEType

        @Nullable
        public java.lang.String getMIMEType()
        Returns the canonized MIME type (converted to lower case).
        Returns:
        the canonized MIME type (converted to lower case)