public class HttpAcceptHeaderProfile extends BasicProfile
This profile implementation exposes the requesting useragent's "Accept" header media types as part of the profile set. This class represents a single media type. See RFC2068 section 14.1.
The profile name is of the form
"accept" ":" "media-range"
This class also provides access to the Accept header media parameters
via the getParam methods (getParam(String)
and
getParamNumeric(String, double)
).
DEFAULT_PROFILE
Constructor and Description |
---|
HttpAcceptHeaderProfile(String media,
String[] params)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getParam(String name)
Get the named parameter as a string.
|
double |
getParamNumeric(String name,
double defaultVal)
Get the named parameter as a numeric value.
|
getName
public String getParam(String name)
name
- Parameter name.public double getParamNumeric(String name, double defaultVal) throws NumberFormatException
Use this method for extracting
name
- Parameter name.defaultVal
if not
defined.NumberFormatException
- The requested parameter value is a not a numeric value.Copyright © 2020. All rights reserved.