Class MediaType


  • public class MediaType
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected MediaType​(java.lang.String type, java.lang.String subtype, java.util.LinkedHashMap<java.lang.String,​java.lang.String> parameters)  
    • Constructor Detail

      • MediaType

        protected MediaType​(java.lang.String type,
                            java.lang.String subtype,
                            java.util.LinkedHashMap<java.lang.String,​java.lang.String> parameters)
    • Method Detail

      • getType

        public java.lang.String getType()
      • getSubtype

        public java.lang.String getSubtype()
      • getCharset

        public java.lang.String getCharset()
      • getParameterCount

        public int getParameterCount()
      • getParameterValue

        public java.lang.String getParameterValue​(java.lang.String parameter)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringNoCharset

        public java.lang.String toStringNoCharset()
      • parseMediaType

        public static MediaType parseMediaType​(java.io.StringReader input)
                                        throws java.io.IOException
        Parses a MediaType value, either from an HTTP header or from an application.
        Parameters:
        input - a reader over the header text
        Returns:
        a MediaType parsed from the input, or null if not valid
        Throws:
        java.io.IOException - if there was a problem reading the input