src/org/kocakosm/pitaya/net/MediaType.java
public static MediaType parse(String input)
	{
		Parameters.checkNotNull(input);
		Matcher m = MEDIA_TYPE_PATTERN.matcher(input);
		Parameters.checkCondition(m.matches());
		String type = m.group(1);
		String subtype = m.group(2);
		String params = m.group(3);
		ParametersParser parser = new ParametersParser();
		return create(type, subtype, parser.parse(params));
	}
public static MediaType parse(String input)
	{
		Parameters.checkNotNull(input);
		Matcher m = MEDIA_TYPE_PATTERN.matcher(input);
		Parameters.checkCondition(m.matches());
		String type = m.group(1);
		String subtype = m.group(2);
		String params = m.group(3);
		ParametersParser parser = new ParametersParser();
		return create(type, subtype, parser.parse(params));
	}
Parses a {@code MediaType} from its {@code String} representation.

@param input the input {@code String} to be parsed.

@return the parsed {@code MediaType} instance.

@throws NullPointerException if {@code input} is {@code null}.
@throws IllegalArgumentException if {@code input} can't be parsed or
if a wildcard is used for the type, but not for the subtype.