Package io.vertx.httpproxy
Interface MediaType
-
public interface MediaType
Represent a Media type (rfc6838).- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description static MediaType
ANY
static MediaType
APPLICATION
static MediaType
APPLICATION_JSON
static MediaType
APPLICATION_OCTET_STREAM
static MediaType
TEXT
static MediaType
TEXT_PLAIN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
accepts(MediaType other)
String
parameter(String name)
Return a media type parameterstatic MediaType
parse(String s)
Parse a media type.static List<MediaType>
parseAcceptHeader(String header)
Parse an accept header which is a list of media typesString
subType()
String
type()
-
-
-
Method Detail
-
parseAcceptHeader
static List<MediaType> parseAcceptHeader(String header) throws IllegalArgumentException
Parse an accept header which is a list of media types- Parameters:
header
- the header- Returns:
- the list of media types
- Throws:
IllegalArgumentException
- when the list is not valid
-
parse
static MediaType parse(String s)
Parse a media type.- Parameters:
s
- the string representation- Returns:
- the parsed media type or
null
when the string to parse is not valid
-
type
String type()
- Returns:
- the type or
null
when everything is matched (*)
-
subType
String subType()
- Returns:
- the sub type or
null
when everything is matched (*)
-
accepts
boolean accepts(MediaType other)
- Returns:
- whether the
other
mime type is accepted
-
-