code: public static ContentType getOrDefault(
              final HttpEntity entity) throws ParseException, UnsupportedCharsetException {
          ContentType contentType = get(entity);
          return contentType != null ? contentType : DEFAULT_TEXT;
      }
docs: Extracts <code>Content-Type</code> value from {@link HttpEntity} or returns default value
  if not explicitly specified.
  
  @param entity HTTP entity
  @return content type
  @throws ParseException if the given text does not represent a valid
  <code>Content-Type</code> value.