public class AcceptHeader
extends java.lang.Object
Constructor and Description |
---|
AcceptHeader(java.lang.String acceptS)
Parses the given value of the Accept field of HTTP request header.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Float> |
getMimeTypes()
Gets the association between each extracted MIME type and its respective quality.
|
java.util.List<java.lang.String> |
getOrderedMimeTypes()
Gets a list of the extracted MIME types, ordered by their respective quality.
|
java.lang.String |
getPreferredMimeType()
Gets the preferred MIME type (HTML, JSON or * /*) according to the order and the quality of all extracted MIME types.
|
void |
setMimeTypes(java.util.Map<java.lang.String,java.lang.Float> mimeTypes)
Sets the association between MIME types and their quality.
|
public AcceptHeader(java.lang.String acceptS)
acceptS
- The list of MIME types to parse.public final java.util.Map<java.lang.String,java.lang.Float> getMimeTypes()
public final void setMimeTypes(java.util.Map<java.lang.String,java.lang.Float> mimeTypes)
mimeTypes
- MIME types and their quality.public java.lang.String getPreferredMimeType()
public java.util.List<java.lang.String> getOrderedMimeTypes()