public static MediaType parseMediaType(String typeStr){
  Matcher typeMatcher=RE_ACCEPT_FRAGMENT.matcher(typeStr);
  if (typeMatcher.find()) {
    return new MediaType(typeMatcher.group(1),typeMatcher.group(2));
  }
 else {
    throw new IllegalArgumentException(typeStr);
  }
}

public static MediaType parseMediaType ( String typeStr ) { Matcher typeMatcher = RE_ACCEPT_FRAGMENT . matcher ( typeStr ) ; if ( typeMatcher . find ( ) ) { return new MediaType ( typeMatcher . group ( 1 ) , typeMatcher . group ( 2 ) ) ; } else { throw new IllegalArgumentException ( typeStr ) ; } }
parse from the given string contains media type .
