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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MimeMultipartParser
public MimeMultipartParser(InputStream in,
String contentType,
StreamingAttachmentFeature feature)
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