javax.mail.internet
Class MimeMultipart

java.lang.Object
  extended byjavax.mail.Multipart
      extended byjavax.mail.internet.MimeMultipart

public class MimeMultipart
extends Multipart

Version:
$Rev: 267505 $ $Date: 2005-09-03 16:16:22 -0600 (Sat, 03 Sep 2005) $

Nested Class Summary
private  class MimeMultipart.MimeBodyPartInputStream
           
 
Field Summary
private static byte[] crlf
           
private static byte[] dash
           
protected  DataSource ds
          DataSource that provides our InputStream.
protected  boolean parsed
          Indicates if the data has been parsed.
private static int part
           
private  ContentType type
           
 
Fields inherited from class javax.mail.Multipart
contentType, parent, parts
 
Constructor Summary
MimeMultipart()
          Create an empty MimeMultipart with content type "multipart/mixed"
MimeMultipart(java.lang.String subtype)
          Create an empty MimeMultipart with the subtype supplied.
 
Method Summary
protected  InternetHeaders createInternetHeaders(java.io.InputStream in)
           
protected  MimeBodyPart createMimeBodyPart(java.io.InputStream in)
           
protected  MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] data)
           
 BodyPart getBodyPart(int part)
          Get the specified part; numbering starts at zero.
 BodyPart getBodyPart(java.lang.String cid)
           
private static java.lang.String getBoundary()
           
 int getCount()
          Return the number of enclosed parts
protected  void parse()
           
private  boolean readTillFirstBoundary(java.io.PushbackInputStream pushbackInStream, byte[] boundary)
          Move the read pointer to the begining of the first part read till the end of first boundary
 void setSubType(java.lang.String subtype)
           
protected  void updateHeaders()
           
 void writeTo(java.io.OutputStream out)
          Encode and write this multipart to the supplied OutputStream; the encoding used is determined by the implementation.
 
Methods inherited from class javax.mail.Multipart
addBodyPart, addBodyPart, getContentType, getParent, removeBodyPart, removeBodyPart, setMultipartDataSource, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ds

protected DataSource ds
DataSource that provides our InputStream.


parsed

protected boolean parsed
Indicates if the data has been parsed.


type

private transient ContentType type

dash

private static byte[] dash

crlf

private static byte[] crlf

part

private static int part
Constructor Detail

MimeMultipart

public MimeMultipart()
Create an empty MimeMultipart with content type "multipart/mixed"


MimeMultipart

public MimeMultipart(java.lang.String subtype)
Create an empty MimeMultipart with the subtype supplied.

Parameters:
subtype - the subtype
Method Detail

setSubType

public void setSubType(java.lang.String subtype)
                throws MessagingException
Throws:
MessagingException

getCount

public int getCount()
             throws MessagingException
Description copied from class: Multipart
Return the number of enclosed parts

Overrides:
getCount in class Multipart
Returns:
the number of parts
Throws:
MessagingException

getBodyPart

public BodyPart getBodyPart(int part)
                     throws MessagingException
Description copied from class: Multipart
Get the specified part; numbering starts at zero.

Overrides:
getBodyPart in class Multipart
Parameters:
part - the part to get
Returns:
the part
Throws:
MessagingException

getBodyPart

public BodyPart getBodyPart(java.lang.String cid)
                     throws MessagingException
Throws:
MessagingException

updateHeaders

protected void updateHeaders()
                      throws MessagingException
Throws:
MessagingException

writeTo

public void writeTo(java.io.OutputStream out)
             throws java.io.IOException,
                    MessagingException
Description copied from class: Multipart
Encode and write this multipart to the supplied OutputStream; the encoding used is determined by the implementation.

Specified by:
writeTo in class Multipart
Parameters:
out - the stream to write to
Throws:
MessagingException
java.io.IOException

parse

protected void parse()
              throws MessagingException
Throws:
MessagingException

readTillFirstBoundary

private boolean readTillFirstBoundary(java.io.PushbackInputStream pushbackInStream,
                                      byte[] boundary)
                               throws MessagingException
Move the read pointer to the begining of the first part read till the end of first boundary

Parameters:
pushbackInStream -
boundary -
Throws:
MessagingException

createInternetHeaders

protected InternetHeaders createInternetHeaders(java.io.InputStream in)
                                         throws MessagingException
Throws:
MessagingException

createMimeBodyPart

protected MimeBodyPart createMimeBodyPart(InternetHeaders headers,
                                          byte[] data)
                                   throws MessagingException
Throws:
MessagingException

createMimeBodyPart

protected MimeBodyPart createMimeBodyPart(java.io.InputStream in)
                                   throws MessagingException
Throws:
MessagingException

getBoundary

private static java.lang.String getBoundary()