Esempio n. 1
0
  /**
   * 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
   */
  public static MediaType getContentType(String format) {
    if (format == null) {
      format = "text/html";
    } else if (format.indexOf('/') <= 0) {
      format = "text/" + format;
    }

    return HttpHelper.getContentType(format);
  }