Beispiel #1
0
 private static Content getJoinedContent(MimePart part) throws IOException, MessagingException {
   Content result = new Content();
   MimeMultipart mp = (MimeMultipart) part.getContent();
   for (int i = 0; i < mp.getCount(); i++) {
     MimeBodyPart p = (MimeBodyPart) mp.getBodyPart(i);
     result.merge(processPart(p, part));
   }
   return result;
 }
Beispiel #2
0
 private static Content getContentWithAttachments(MimePart part)
     throws MessagingException, IOException {
   Content result = new Content();
   String rootId = new ContentType(part.getContentType()).getParameter("start");
   MimeMultipart mp = (MimeMultipart) part.getContent();
   for (int i = 0; i < mp.getCount(); i++) {
     MimePart p = (MimePart) mp.getBodyPart(i);
     if (isRootPart(p, i, rootId)) {
       result = result.merge(processPart(p, part));
     } else {
       result.attachments.add(p);
     }
   }
   return result;
 }
Beispiel #3
0
 private static Content getContent(MimePart part) throws IOException, MessagingException {
   Content result = new Content();
   result.body = (String) part.getContent();
   result.type = part.getContentType();
   return result;
 }