SHOW Signed

net.rim.blackberry.api.mail
Class BodyPart

java.lang.Object
  |
  +--net.rim.blackberry.api.mail.BodyPart
All Implemented Interfaces:
Part
Direct Known Subclasses:
ContactAttachmentPart, SupportedAttachmentPart, TextBodyPart, UnsupportedAttachmentPart

public abstract class BodyPart
extends Object
implements Part

Represents a Part that is contained in a Multipart. A BodyPart consists of headers (attributes) and a body (contents). This is an abstract class; subclasses provide actual implementations. The BlackBerry Mail API provides four classes that implement different types of body parts: TextBodyPart, ContactAttachmentPart, SupportedAttachmentPart, and UnsupportedAttachmentPart.

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:
Multipart

Inner Class Summary
 Category: Signed static interface BodyPart.ContentType
          Contants defining some common attachment types and subtypes
 
Field Summary
 Category: Signed protected  Multipart _parent
          The Multipart object that contains this BodyPart.
 Category: Signed static String CONTENT_TYPE
          Defines the CONTENT_TYPE header.
 Category: Signed protected static byte[] CRLF
           
 Category: Signed protected static byte[] EMPTY
           
 Category: Signed protected static char SEPARATOR
           
 
Fields inherited from interface net.rim.blackberry.api.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
 Category: Signed protected BodyPart(Multipart parent)
          Constructs a BodyPart object.
 
Method Summary
 Category: Signed  void addHeader(String name, String value)
          Adds a header.
 Category: Signed  Enumeration getAllHeaders()
          Retrieves all headers from this body part.
 Category: Signed  String getContentType()
          Retrieves the value of the CONTENT_TYPE header.
 Category: Signed  String[] getHeader(String header)
          Retrieves all headers of a specific name.
 Category: Signed  Multipart getParent()
          Retrieves the Multipart object that contains this BodyPart.
 Category: Signed  boolean hasMore()
          Determines if more data for this body part is available on the server.
 Category: Signed  boolean isMimeType(String mimeType)
          Determines whether this body part is of the specified MIME type.
 Category: Signed  boolean moreRequestSent()
          Determines if a request has been sent for more data for this body part.
 Category: Signed  void removeHeader(String header)
          Removes a header from the body part.
 Category: Signed  void setContentType(String value)
          Sets the CONTENT_TYPE header value.
 Category: Signed  void setHeader(String header, String value)
          Sets a header.
 Category: Signed  void writeTo(OutputStream os)
          Writes information about the BodyPart content type to an output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.rim.blackberry.api.mail.Part
getContent, getInputStream, getSize, setContent
 

Field Detail

CONTENT_TYPE

public static String CONTENT_TYPE
Defines the CONTENT_TYPE header.
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.

SEPARATOR

protected static final char SEPARATOR
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.

CRLF

protected static final byte[] CRLF
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.

EMPTY

protected static final byte[] EMPTY
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 Multipart _parent
The Multipart object that contains this BodyPart.
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

BodyPart

protected BodyPart(Multipart parent)
Constructs a BodyPart object.

Parameters:
parent - The Multipart object that contains this BodyPart.
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

getParent

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

Returns:
The Multipart object that contains this BodyPart, 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.

addHeader

public void addHeader(String name,
                      String value)
Adds a header. Only the CONTENT_TYPE header is supported.
Specified by:
addHeader in interface Part
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.

getAllHeaders

public Enumeration getAllHeaders()
Retrieves all headers from this body part.
Specified by:
getAllHeaders in interface Part
Following copied from interface: net.rim.blackberry.api.mail.Part
Returns:
An enumeration of header fields.
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 value of the CONTENT_TYPE header.

Specified by:
getContentType in interface Part
Returns:
The MIME type for this body part.
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.

setContentType

public void setContentType(String value)
Sets the CONTENT_TYPE header value.

Parameters:
value - MIME type to set for the CONTENT_TYPE header.
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.

getHeader

public String[] getHeader(String header)
Retrieves all headers of a specific name.

Only the CONTENT_TYPE header is supported.

Specified by:
getHeader in interface Part
Returns:
a string array containing the values for the specified header, or an empty array (String[0]) if the header is not supported
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.

isMimeType

public boolean isMimeType(String mimeType)
Determines whether this body part is of the specified MIME type.

Specified by:
isMimeType in interface Part
Parameters:
mimeType - A MIME type.
Returns:
True if the body part is of the specified MIME type; 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.

removeHeader

public void removeHeader(String header)
Removes a header from the body part. Only the CONTENT_TYPE header is supported.

Specified by:
removeHeader in interface Part
Parameters:
header - The header to remove.
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.

setHeader

public void setHeader(String header,
                      String value)
Sets a header. Only the CONTENT_TYPE header is supported.

Specified by:
setHeader in interface Part
Parameters:
header - Header to set.
value - Value to set for the specified header.
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.

writeTo

public void writeTo(OutputStream os)
             throws IOException
Writes information about the BodyPart content type to an output stream.

Specified by:
writeTo in interface Part
Parameters:
os - Output byte stream.
Throws:
IOException - Signals that an I/O error has occurred.
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.

hasMore

public boolean hasMore()
Determines if more data for this body part is available on the server.

Returns:
True if more data is available, otherwise false.
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.

moreRequestSent

public boolean moreRequestSent()
Determines if a request has been sent for more data for this body part.

Returns:
True if more data has been requested for this body part, otherwise false.
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.