public boolean isJsonMime(String mime) {
      String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$";
      return mime != null && (mime.matches(jsonMime) || mime.equals("*/*"));
    }
public boolean isJsonMime ( String mime ) { String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$" ; return mime != null && ( mime . matches ( jsonMime ) || mime . equals ( "*/*" ) ) ; }
Check if the given MIME is a JSON MIME.
JSON MIME examples:
application/json
application/json; charset=UTF8
APPLICATION/JSON
application/vnd.company+json
"* / *" is also default to JSON
@param mime MIME (Multipurpose Internet Mail Extensions)
@return True if the given MIME is JSON, false otherwise.