The MimeMultipart class is an implementation that uses MIME conventions for the multipart data.
A MimeMultipart is obtained from a MimeBodyPart whose primary type is "multipart" (by invoking the part's getContent()
method) or it can be created by a client as part of creating a new MimeMessage.
The default multipart subtype is "mixed". The other multipart subtypes, such as "alternative", "related", and so on, can be implemented as subclasses of MimeMultipart with additional methods to implement the additional semantics of that type of multipart content. The intent is that service providers, mail JavaBean writers and mail clients will write many such subclasses and their Command Beans, and will install them into the JavaBeans Activation Framework, so that any JavaMail implementation and its clients can transparently find and use these classes. Thus, a MIME multipart handler is treated just like any other type handler, thereby decoupling the process of providing multipart handlers from the JavaMail API. Lacking these additional MimeMultipart subclasses, all subtypes of MIME multipart data appear as MimeMultipart objects.
An application can directly construct a MIME multipart object of any subtype by using the MimeMultipart(String subtype)
constructor. For example, to create a "multipart/alternative" object, use new MimeMultipart("alternative")
.
@version 1.31, 03/01/29
@author John Mani
@author Bill Shannon
@author Max Spivak