com.sun.xml.ws.encoding
Class MimeMultipartParser

java.lang.Object
  extended by 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.


Nested Class Summary
(package private) static class MimeMultipartParser.PartAttachment
           
 
Constructor Summary
MimeMultipartParser(InputStream in, String contentType, StreamingAttachmentFeature feature)
           
 
Method Summary
 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.
 Attachment getRootPart()
          Parses the stream and returns the root part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeMultipartParser

public MimeMultipartParser(InputStream in,
                           String contentType,
                           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