Top Description Fields Constructors Methods
org.apache.tomcat.util.http.parser

public Class MediaTypeCache

extends Object
Class Inheritance
Imports
java.io.IOException, .StringReader, org.apache.tomcat.util.collections.ConcurrentCache

Caches the results of parsing content-type headers.

Field Summary

Modifier and TypeField and Description
private final ConcurrentCache<String, String[]>

Constructor Summary

AccessConstructor and Description
public
MediaTypeCache(int size)

Method Summary

Modifier and TypeMethod and Description
public String[]

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
parse
(String
The content-type header value to parse
input
)

Looks in the cache and returns the cached value if one is present.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
private final ConcurrentCache<String, String[]> cache

Constructor Detail

MediaTypeCacheback to summary
public MediaTypeCache(int size)

Method Detail

parseback to summary
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:String

The content-type header value to parse

Returns:String[]

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