MediaType (Apache Tomcat 10.0.27 API Documentation)

Package org.apache.tomcat.util.http.parser

## Class MediaType

- java.lang.Object
- - org.apache.tomcat.util.http.parser.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)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.lang.String` | `getCharset()` |
    `int` | `getParameterCount()` |
    `java.lang.String` | `getParameterValue​(java.lang.String parameter)` |
    `java.lang.String` | `getSubtype()` |
    `java.lang.String` | `getType()` |
    `static MediaType` | `parseMediaType​(java.io.StringReader input)` | Parses a MediaType value, either from an HTTP header or from an application.
    `java.lang.String` | `toString()` |
    `java.lang.String` | `toStringNoCharset()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### 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