com.sun.xml.internal.org.jvnet.mimepull.MIMEPart Java Examples

The following examples show how to use com.sun.xml.internal.org.jvnet.mimepull.MIMEPart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MimePullMultipart.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #2
Source File: MimeMultipartParser.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #3
Source File: MimeMultipartParser.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #4
Source File: MimeMultipartParser.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #5
Source File: MimePullMultipart.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #6
Source File: MimePullMultipart.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #7
Source File: MimePullMultipart.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #8
Source File: MimePullMultipart.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #9
Source File: MimeMultipartParser.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #10
Source File: MimeMultipartParser.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #11
Source File: MimeMultipartParser.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #12
Source File: MimePullMultipart.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #13
Source File: MimeMultipartParser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #14
Source File: MimePullMultipart.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #15
Source File: MimePullMultipart.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void parseAll() throws MessagingException {
    if (parsed) {
        return;
    }
    if (soapPart == null) {
        readSOAPPart();
    }

    List<MIMEPart> prts = mm.getAttachments();
    for(MIMEPart part : prts) {
        if (part != soapPart) {
            AttachmentPart attach = new AttachmentPartImpl(part);
            this.addBodyPart(new MimeBodyPart(part));
        }
   }
   parsed = true;
}
 
Example #16
Source File: MimeMultipartParser.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Parses the entire stream and returns all MIME parts except root MIME part.
 *
 * @return Map<String, StreamAttachment> for all attachment parts
 */
public @NotNull Map<String, Attachment> getAttachmentParts() {
    if (!gotAll) {
        MIMEPart rootPart = (start != null) ? message.getPart(start) : message.getPart(0);
        List<MIMEPart> parts = message.getAttachments();
        for(MIMEPart part : parts) {
            if (part != rootPart) {
                String cid = part.getContentId();
                if (!attachments.containsKey(cid)) {
                    PartAttachment attach = new PartAttachment(part);
                    attachments.put(attach.getContentId(), attach);
                }
            }
        }
        gotAll = true;
    }
    return attachments;
}
 
Example #17
Source File: AttachmentPartImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public AttachmentPartImpl(MIMEPart part) {
    headers = new MimeHeaders();
    mimePart = part;
    List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = part.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}
 
Example #18
Source File: MimePullMultipart.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public  MIMEPart readAndReturnSOAPPart() throws  MessagingException {
     if (soapPart != null) {
        throw new MessagingException("Inputstream from datasource was already consumed");
     }
     readSOAPPart();
     return soapPart;

}
 
Example #19
Source File: MimeBodyPart.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public MimeBodyPart(MIMEPart part) {
   mimePart = part;
   headers = new InternetHeaders();
   List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = mimePart.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}
 
Example #20
Source File: MimeMultipartParser.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method can be called to get a matching MIME attachment part for the
 * given contentId. It parses the stream until it finds a matching part.
 *
 * @return StreamAttachment attachment for contentId
 *         null if there is no attachment for contentId
 */
public @Nullable Attachment getAttachmentPart(String contentId) throws IOException {
    //first see if this attachment is already parsed, if so return it
    Attachment attach = attachments.get(contentId);
    if (attach == null) {
        MIMEPart part = message.getPart(contentId);
        attach = new PartAttachment(part);
        attachments.put(contentId, attach);
    }
    return attach;
}
 
Example #21
Source File: AttachmentPartImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public AttachmentPartImpl(MIMEPart part) {
    headers = new MimeHeaders();
    mimePart = part;
    List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = part.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}
 
Example #22
Source File: MimeMultipartParser.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method can be called to get a matching MIME attachment part for the
 * given contentId. It parses the stream until it finds a matching part.
 *
 * @return StreamAttachment attachment for contentId
 *         null if there is no attachment for contentId
 */
public @Nullable Attachment getAttachmentPart(String contentId) throws IOException {
    //first see if this attachment is already parsed, if so return it
    Attachment attach = attachments.get(contentId);
    if (attach == null) {
        MIMEPart part = message.getPart(contentId);
        attach = new PartAttachment(part);
        attachments.put(contentId, attach);
    }
    return attach;
}
 
Example #23
Source File: MimePullMultipart.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public  MIMEPart readAndReturnSOAPPart() throws  MessagingException {
     if (soapPart != null) {
        throw new MessagingException("Inputstream from datasource was already consumed");
     }
     readSOAPPart();
     return soapPart;

}
 
Example #24
Source File: MimeBodyPart.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public MimeBodyPart(MIMEPart part) {
   mimePart = part;
   headers = new InternetHeaders();
   List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = mimePart.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}
 
Example #25
Source File: MimeMultipartParser.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * This method can be called to get a matching MIME attachment part for the
 * given contentId. It parses the stream until it finds a matching part.
 *
 * @return StreamAttachment attachment for contentId
 *         null if there is no attachment for contentId
 */
public @Nullable Attachment getAttachmentPart(String contentId) throws IOException {
    //first see if this attachment is already parsed, if so return it
    Attachment attach = attachments.get(contentId);
    if (attach == null) {
        MIMEPart part = message.getPart(contentId);
        attach = new PartAttachment(part);
        attachments.put(contentId, attach);
    }
    return attach;
}
 
Example #26
Source File: AttachmentPartImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public AttachmentPartImpl(MIMEPart part) {
    headers = new MimeHeaders();
    mimePart = part;
    List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = part.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}
 
Example #27
Source File: MimePullMultipart.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public  MIMEPart readAndReturnSOAPPart() throws  MessagingException {
     if (soapPart != null) {
        throw new MessagingException("Inputstream from datasource was already consumed");
     }
     readSOAPPart();
     return soapPart;

}
 
Example #28
Source File: MimeBodyPart.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public MimeBodyPart(MIMEPart part) {
   mimePart = part;
   headers = new InternetHeaders();
   List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = mimePart.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}
 
Example #29
Source File: MimePullMultipart.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public  MIMEPart readAndReturnSOAPPart() throws  MessagingException {
     if (soapPart != null) {
        throw new MessagingException("Inputstream from datasource was already consumed");
     }
     readSOAPPart();
     return soapPart;

}
 
Example #30
Source File: AttachmentPartImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public AttachmentPartImpl(MIMEPart part) {
    headers = new MimeHeaders();
    mimePart = part;
    List<? extends com.sun.xml.internal.org.jvnet.mimepull.Header> hdrs = part.getAllHeaders();
    for (com.sun.xml.internal.org.jvnet.mimepull.Header hd : hdrs) {
        headers.addHeader(hd.getName(), hd.getValue());
    }
}