Package io.vertx.httpproxy
Interface MediaType
-
public interface MediaTypeRepresent a Media type (rfc6838).- Author:
- Julien Viet
-
-
Field Summary
Fields Modifier and Type Field Description static MediaTypeANYstatic MediaTypeAPPLICATIONstatic MediaTypeAPPLICATION_JSONstatic MediaTypeAPPLICATION_OCTET_STREAMstatic MediaTypeTEXTstatic MediaTypeTEXT_PLAIN
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccepts(MediaType other)Stringparameter(String name)Return a media type parameterstatic MediaTypeparse(String s)Parse a media type.static List<MediaType>parseAcceptHeader(String header)Parse an accept header which is a list of media typesStringsubType()Stringtype()
-
-
-
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
nullwhen the string to parse is not valid
-
type
String type()
- Returns:
- the type or
nullwhen everything is matched (*)
-
subType
String subType()
- Returns:
- the sub type or
nullwhen everything is matched (*)
-
accepts
boolean accepts(MediaType other)
- Returns:
- whether the
othermime type is accepted
-
-