com.funambol.mail
Class Multipart

java.lang.Object
  extended by com.funambol.mail.Multipart

public class Multipart
extends java.lang.Object

Represents a container for BodyParts in multi-part Messages as per RFC 2046


Constructor Summary
Multipart()
          Constructs a Multipart object of the given content type.
 
Method Summary
 void addBodyPart(BodyPart part)
          Insert the part at the end of the MultiPart.
 void addBodyPart(BodyPart part, int index)
          Insert the part at the specified index.
 void deserialize(java.io.DataInputStream din)
           
 BodyPart getBodyPart(int index)
          Get the BodyPart at the specified index.
 Part getContainer()
          Return the container object for this Multipart.
 int getCount()
          Retrieves the number of body parts contained in this multi-part
 void removeBodyPart(int index)
          Removes the BodyPart at the specified index.
 void serialize(java.io.DataOutputStream dout)
           
 void setContainer(Part container)
          Set the container object for this Multipart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Multipart

public Multipart()
Constructs a Multipart object of the given content type. A unique boundary string is generated and this string is setup as the "boundary" string to separate BodyParts in the formatted message.

BodyParts can be added later

Method Detail

getContainer

public Part getContainer()
Return the container object for this Multipart.

Returns:
A Message or a BodyPart

setContainer

public void setContainer(Part container)
Set the container object for this Multipart. Normally called by the Message or BodyPart setContent(Multipart) method

Parameters:
container -

addBodyPart

public void addBodyPart(BodyPart part)
Insert the part at the end of the MultiPart.

Parameters:
part - The BodyPart to be added to this Multipart container

addBodyPart

public void addBodyPart(BodyPart part,
                        int index)
Insert the part at the specified index.

Parameters:
part - The BodyPart to be added to this Multipart container
index - The position

getBodyPart

public BodyPart getBodyPart(int index)
Get the BodyPart at the specified index.

Parameters:
index - the index of the BodyPart
Returns:
the requested BodyPart

removeBodyPart

public void removeBodyPart(int index)
Removes the BodyPart at the specified index.

Parameters:
index - the index of the BodyPart

getCount

public int getCount()
Retrieves the number of body parts contained in this multi-part


serialize

public void serialize(java.io.DataOutputStream dout)
               throws java.io.IOException
Throws:
java.io.IOException

deserialize

public void deserialize(java.io.DataInputStream din)
                 throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2001-2009 Funambol.