Package com.sun.xml.ws.encoding
Class MimeMultipartParser
- java.lang.Object
-
- com.sun.xml.ws.encoding.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
-
-
Constructor Summary
Constructors Constructor Description MimeMultipartParser(InputStream in, String cType, StreamingAttachmentFeature feature)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attachment
getAttachmentPart(String contentId)
This method can be called to get a matching MIME attachment part for the given contentId.Map<String,Attachment>
getAttachmentParts()
Parses the entire stream and returns all MIME parts except root MIME part.ContentTypeImpl
getContentType()
Attachment
getRootPart()
Parses the stream and returns the root part.
-
-
-
Constructor Detail
-
MimeMultipartParser
public MimeMultipartParser(InputStream in, String cType, StreamingAttachmentFeature feature)
-
-
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
-
getContentType
public ContentTypeImpl getContentType()
-
-