code: public static String getContentType(Calendar calendar, Charset charset) {
          final StringBuilder b = new StringBuilder("text/calendar");
          
          final Method method = calendar.getProperty(Property.METHOD);
          if (method != null) {
              b.append("; method=");
              b.append(method.getValue());
          }
          
          if (charset != null) {
              b.append("; charset=");
              b.append(charset);
          }
          return b.toString();
      }
docs: Returns an appropriate MIME Content-Type for the specified calendar object.
  @param calendar a calendar instance
  @param charset an optional encoding
  @return a content type string