SHOW Signed

net.rim.blackberry.api.mail
Interface Part

All Known Implementing Classes:
BodyPart, Message

public interface Part

Defines the header fields and contents of a Message, or a BodyPart in a Multipart entity.

A Part consists of a set of header fields and a body (contents).

Part has a standard set of header fields (also called attributes) that are common to most existing mail systems. The BlackBerry Mail API currently only supports the Content-Type header, which defines the MIME data type of the body. This data type is returned by the getContentType() method. The contents are returned by the getContent() method.

The writeTo() method outputs the Part to a byte stream in a form that is suitable for mail transmission. This byte stream is typically an aggregation of the header fields and 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.

See Also:
RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies

Field Summary
 Category: Signed static String ATTACHMENT
          Presents this Part as an attachment.
 Category: Signed static String INLINE
          Presents this Part inline.
 
Method Summary
 Category: Signed  void addHeader(String header_name, String header_value)
          Adds a value to the header field.
 Category: Signed  Enumeration getAllHeaders()
          Retrieves all the header fields from this Part.
 Category: Signed  Object getContent()
          Retrieves the contents of the Part.
 Category: Signed  String getContentType()
          Retrieves the Content-Type header field of this Part.
 Category: Signed  String[] getHeader(String header_name)
          Retrieves all the header fields with this name.
 Category: Signed  InputStream getInputStream()
          Retrieves an input stream for the contents of this Part.
 Category: Signed  int getSize()
          Retrieves the size of the contents of this Part.
 Category: Signed  boolean isMimeType(String mimeType)
          Determines if this part is of the specified MIME type.
 Category: Signed  void removeHeader(String header_name)
          Removes all header fields with this name.
 Category: Signed  void setContent(Object ch)
          Sets the contents of this Part.
 Category: Signed  void setHeader(String header_name, String header_value)
          Sets the value for this header field.
 Category: Signed  void writeTo(OutputStream os)
          Outputs a byte stream for this Part, in a form that is suitable for mail transmission.
 

Field Detail

ATTACHMENT

public static final String ATTACHMENT
Presents this Part as an attachment.
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.

INLINE

public static final String INLINE
Presents this Part inline.
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

addHeader

public void addHeader(String header_name,
                      String header_value)
Adds a value to the header field.

Parameters:
header_name - The name of the header field to add.
header_value - The name of the value to set for the header field.
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_name)
Removes all header fields with this name.

Parameters:
header_name - The name of the header fields 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_name,
                      String header_value)
Sets the value for this header field.

Parameters:
header_name - The name of the header field for which to set a value.
header_value - The value to set for the header field.
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_name)
Retrieves all the header fields with this name.

Parameters:
header_name - The name of the header field to get.
Returns:
An array of one or more header fields.
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 the header fields from this 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.

setContent

public void setContent(Object ch)
                throws MessagingException
Sets the contents of this Part.

Parameters:
ch - An object to use for the Part contents.
Throws:
MessagingException - A general messaging 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.

getContent

public Object getContent()
Retrieves the contents of the Part.

Returns:
The contents of a 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.

getContentType

public String getContentType()
Retrieves the Content-Type header field of this Part.

Returns:
The MIME data type of the 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.

isMimeType

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

Parameters:
mimeType - The name of the MIME type for comparison, such as text/plain.
Returns:
True if the part content-type is the same as 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.

getInputStream

public InputStream getInputStream()
Retrieves an input stream for the contents of this Part.

Returns:
An input stream of bytes.
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
Outputs a byte stream for this Part, in a form that is suitable for mail transmission. The byte stream is typically an aggregation of the headers and body.

Parameters:
os - An output stream of bytes.
Throws:
IOException - Signals that an I/O exception 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.

getSize

public int getSize()
Retrieves the size of the contents of this Part.

Returns:
Size in bytes.
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.