code: public static MediaType getContentType(String format) {
          if (format == null) {
              format = "text/html";
          } else if (format.indexOf('/') <= 0) {
              format = "text/" + format;
          }
  
          return new MediaTypeHeaderProvider().fromString(format);
      }
docs: Return the content type represented by the given string.  If the string does not have a "/", assume
  it's "text/{format}".  For example, if format is "xml", the returned media type will be "text/xml".
  
  @param format
  @return the content type represented by the given string