boolean isHtml = pi.getContentType().match(Mime.CT_TEXT_HTML);
boolean isHtml = pi.getContentType().equals(Mime.CT_TEXT_HTML);
    private static void getContent(Element mp, MPartInfo pi) throws IOException, MessagingException {        // TODO: support other parts        ContentType ct = pi.getContentType();        if (ct.match(Mime.CT_TEXT_WILD) || ct.match(Mime.CT_XML_WILD)) {            MimePart part = pi.getMimePart();            Object o = part.getContent();            String cstr = null;            if (o instanceof String) {                cstr = (String) o;            } else if (o instanceof InputStream) {                InputStream is = (InputStream) o;                cstr = new String(ByteUtil.getContent(is, 4096));            } else {                return;            }            //mLog.info("before strip: "+cstr);            String data = StringUtil.stripControlCharacters(cstr);            //mLog.info("after strip: "+data);            boolean isHtml = pi.getContentType().match(Mime.CT_TEXT_HTML);            if (isHtml) {                data = HtmlDefang.defang(data, true);                //mLog.info("after defang: "+data);            }            mp.addAttribute(MailService.E_CONTENT, data, Element.DISP_CONTENT);            //content.addAttribute(MailService.A_CONTENT_TYPE, )            //content.addText((String) part.getContent());            // TODO: CDATA worth the effort?//            if (isHtml && data.indexOf("]]>") == -1)//                content.addCDATA(data);//            else//                content.addText(data);        }    }