DataHandler handler = getDataHandler();  try {  String type = getContentType();  ContentType content = new ContentType(type);  if (content.match("multipart/*")) {  try { MimeMultipart part = (MimeMultipart)handler.getContent(); part.updateHeaders(); } catch (ClassCastException e) { throw new MessagingException("Message content is not MimeMultipart", e); } } else if (!content.match("message/rfc822")) {   if (getHeader("Content-Transfer-Encoding") == null) { setHeader("Content-Transfer-Encoding", MimeUtility.getEncoding(handler)); }   if (getHeader("Content-Type") == null) { if (SessionUtil.getBooleanProperty(MIME_SETDEFAULTTEXTCHARSET, true)) {  if (content.match("text/*")) {   if (content.getParameter("charset") == null) {  String encoding = getEncoding();   if (encoding != null && encoding.equalsIgnoreCase("7bit")) { content.setParameter("charset", "us-ascii"); } else {  content.setParameter("charset", MimeUtility.getDefaultMIMECharset()); } } } } } }   if (getHeader("Content-Type") == null) {   String disp = getHeader("Content-Disposition", null); if (disp != null) {  ContentDisposition disposition = new ContentDisposition(disp);  String filename = disposition.getParameter("filename");  if (filename != null) { content.setParameter("name", filename); } }  setHeader("Content-Type", content.toString()); }  } catch (IOException e) { throw new MessagingException("Error updating message headers", e); }
    protected void updateHeaders() throws MessagingException {    }