String ctype = getContentType(subpart);
String ctype = Mime.getContentType(subpart);
        private BodyPart getPrimaryPart(MimeMultipart multi) throws MessagingException, IOException {            BodyPart primary = null;            int primaryRank = 0;            for (int i = 0; i < multi.getCount(); i++) {                BodyPart subpart = multi.getBodyPart(i);                String ctype = getContentType(subpart);                if (ctype.equals(Mime.CT_MULTIPART_ALTERNATIVE) && subpart instanceof MimeBodyPart) {                    Object content = Mime.getMultipartContent((MimeBodyPart) subpart, ctype);                    if (content instanceof MimeMultipart) {                        subpart = getPrimaryPart((MimeMultipart) content);                        if (subpart == null)                            continue;                        ctype = getContentType(subpart);                    }                }                Integer rank = typeRankings.get(ctype);                if (rank == null)                    rank = 0;                if (primary == null || rank > primaryRank) {                    primary = subpart;                    primaryRank = rank;                }            }            return primary;        }