Class MimeMultipartParser


  • public final class MimeMultipartParser
    extends Object
    Parses Mime multipart message into primary part and attachment parts. It parses the stream lazily as and when required.
    Author:
    Vivek Pandey, Jitendra Kotamraju
    • Method Detail

      • getRootPart

        @Nullable
        public Attachment getRootPart()
        Parses the stream and returns the root part. If start parameter is present in Content-Type, it is used to determine the root part, otherwise root part is the first part.
        Returns:
        StreamAttachment for root part null if root part cannot be found
      • getAttachmentParts

        @NotNull
        public Map<String,​Attachment> getAttachmentParts()
        Parses the entire stream and returns all MIME parts except root MIME part.
        Returns:
        Map for all attachment parts
      • getAttachmentPart

        @Nullable
        public Attachment getAttachmentPart​(String contentId)
                                     throws IOException
        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.
        Returns:
        StreamAttachment attachment for contentId null if there is no attachment for contentId
        Throws:
        IOException