MediaTypeCache (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.tomcat.util.http.parser, class: MediaTypeCache

# Class MediaTypeCache

java.lang.Object
org.apache.tomcat.util.http.parser.MediaTypeCache

public class MediaTypeCache extends Object
Caches the results of parsing content-type headers.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MediaTypeCache(int size)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String[]`
  `parse(String input)`
  Looks in the cache and returns the cached value if one is present.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### MediaTypeCache

    public MediaTypeCache(int size)

- ## Method Details

  - ### parse

    public String[] parse(String input)
    Looks in the cache and returns the cached value if one is present. If no match exists in the cache, a new parser is created, the input parsed and the results placed in the cache and returned to the user.
    Parameters:
      `input` - The content-type header value to parse
    Returns:
      The results are provided as a two element String array. The first element is the media type less the charset and the second element is the charset