SHOW Signed

net.rim.blackberry.api.mail
Class Multipart

java.lang.Object
  |
  +--net.rim.blackberry.api.mail.Multipart

public class Multipart
extends Object

A container that holds multiple BodyParts.

Multipart provides methods to retrieve and set its subparts.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

See Also:
BodyPart, Part

Field Summary
 Category: Signed protected  String _contentType
          Content-type of this multipart object.
 Category: Signed protected  Part _parent
          Part that contains this Multipart, if known.
 Category: Signed protected  Vector _parts
          Vector of BodyPart objects.
 
Constructor Summary
 Category: Signed   Multipart()
          Default constructor - applies a type of multipart/mixed to the object
 Category: Signed protected Multipart(Part parent)
          Constructor with parent part and default TYPE of multipart/mixed.
 Category: Signed   Multipart(String type)
          Creates a Multipart with the specified type.
 Category: Signed protected Multipart(String type, Part parent)
          Constructor with parent Part.
 
Method Summary
 Category: Signed  void addBodyPart(BodyPart part)
          Adds a BodyPart to the Multipart.
 Category: Signed  void addBodyPart(BodyPart part, int index)
          Adds a BodyPart at position index.
 Category: Signed  BodyPart getBodyPart(int index)
          Retrieves the specified Part.
 Category: Signed  String getContentType()
          Retrieves the content-type of this Multipart.
 Category: Signed  int getCount()
          Retrieves the number of enclosed BodyPart objects.
 Category: Signed  Part getParent()
          Retrieves the Part that contains this Multipart object.
 Category: Signed  boolean removeBodyPart(BodyPart part)
          Removes the specified BodyPart from the multipart message.
 Category: Signed  void removeBodyPart(int index)
          Removes the Part at specified location (starting from 0).
 Category: Signed  void setParent(Part parent)
          Sets the parent of this Multipart to be the specified Part.
 Category: Signed  void writeTo(OutputStream os)
          Outputs an appropriately encoded bytestream to the given OutputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_contentType

protected String _contentType
Content-type of this multipart object.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

_parent

protected Part _parent
Part that contains this Multipart, if known.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

_parts

protected Vector _parts
Vector of BodyPart objects.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Constructor Detail

Multipart

public Multipart()
Default constructor - applies a type of multipart/mixed to the object
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Multipart

public Multipart(String type)
Creates a Multipart with the specified type.

Parameters:
type - The type of the Multipart. Some messaging systems provide different subtypes of Multiparts. For example, MIME specifies a set of subtypes that include "alternative", "mixed", "related", "parallel", "signed", etc.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Multipart

protected Multipart(String type,
                    Part parent)
Constructor with parent Part.

Parameters:
type - The type of the Multipart. Some messaging systems provide different subtypes of Multiparts. For example, MIME specifies a set of subtypes that include "alternative", "mixed", "related", "parallel", "signed", and so on.
parent - The Part that owns this Multipart.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Multipart

protected Multipart(Part parent)
Constructor with parent part and default TYPE of multipart/mixed.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

writeTo

public void writeTo(OutputStream os)
             throws IOException

Outputs an appropriately encoded bytestream to the given OutputStream.

This method is not thread safe.

Parameters:
os - An output stream of bytes.
Throws:
IOException - A general I/O error.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

addBodyPart

public void addBodyPart(BodyPart part)
Adds a BodyPart to the Multipart.

Parameters:
part - A BodyPart object to add to this Multipart. If null, no operation is performed.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

addBodyPart

public void addBodyPart(BodyPart part,
                        int index)
Adds a BodyPart at position index.

Parameters:
part - A BodyPart object to add to this Multipart. If null, no operation is performed.
index - An index to indicate the position in the Multipart at which to add the BodyPart.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getBodyPart

public BodyPart getBodyPart(int index)
Retrieves the specified Part.

Parameters:
index - An index to indicate the position of the BodyPart to retrieve.
Returns:
A BodyPart object from the specified position in the Multipart.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getContentType

public String getContentType()
Retrieves the content-type of this Multipart.

Returns:
A text string that describes the Multipart contents.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getCount

public int getCount()
Retrieves the number of enclosed BodyPart objects.

Returns:
The number of BodyPart objects.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getParent

public Part getParent()
Retrieves the Part that contains this Multipart object.

Returns:
The Part that contains this Multipart object, or null if unknown.
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

removeBodyPart

public boolean removeBodyPart(BodyPart part)
Removes the specified BodyPart from the multipart message.

Parameters:
part - The BodyPart to remove from the message.
Returns:
True if the BodyPart was removed successfully, otherwise false.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

removeBodyPart

public void removeBodyPart(int index)
Removes the Part at specified location (starting from 0).

Parameters:
index - The location of the BodyPart object in the Multipart.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

setParent

public void setParent(Part parent)
Sets the parent of this Multipart to be the specified Part.

Parameters:
parent - The Part to set as the parent of this Multipart.
Since:
JDE 3.6
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.