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 object.

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

Each 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 type, which defines the MIME content type of the body's contents. Use getContentType() to retrieve the content type, and getContent() to retrieve the actual content.

Use writeTo(java.io.OutputStream) to write out the part's content to a byte stream in a form suitable for mail transmission. This byte stream is typically an aggregation of the header fields and contents. For more information, see RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0

Field Summary
 Category: Signed static String ATTACHMENT
          Present this part as an attachment.
 Category: Signed static String INLINE
          Present this part inline.
 
Method Summary
 Category: Signed  void addHeader(String header_name, String header_value)
          Adds a value to header field by name.
 Category: Signed  Enumeration getAllHeaders()
          Retrieves all the header fields for this part.
 Category: Signed  Object getContent()
          Retrieves this part's contents.
 Category: Signed  String getContentType()
          Retrieves the content-type set for this part's contents.
 Category: Signed  String[] getHeader(String header_name)
          Retrieves header fields by name.
 Category: Signed  InputStream getInputStream()
          Retrieves an input stream for this part's contents.
 Category: Signed  int getSize()
          Retrieves the size of this part's contents.
 Category: Signed  boolean isMimeType(String mimeType)
          Determines if this part's contents are of the provided MIME content type.
 Category: Signed  void removeHeader(String header_name)
          Removes all header fields by name.
 Category: Signed  void setContent(Object ch)
          Sets this part's contents.
 Category: Signed  void setHeader(String header_name, String header_value)
          Sets the value for header field by name.
 Category: Signed  void writeTo(OutputStream os)
          Writes this part's contents to a provided output stream.
 

Field Detail

ATTACHMENT

public static final String ATTACHMENT
Present this part as an attachment.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

INLINE

public static final String INLINE
Present this part inline.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

addHeader

public void addHeader(String header_name,
                      String header_value)
Adds a value to header field by name.
Parameters:
header_name - Name of the header field to add.
header_value - Name of the value to set for the header field.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getAllHeaders

public Enumeration getAllHeaders()
Retrieves all the header fields for this part.
Returns:
An enumeration of this part's header fields.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getContent

public Object getContent()
Retrieves this part's contents.
Returns:
Object containing this part's contents.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getContentType

public String getContentType()
Retrieves the content-type set for this part's contents.
Returns:
MIME content type for this part's contents, if set; if not set, this method should return null.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getHeader

public String[] getHeader(String header_name)
Retrieves header fields by name.
Parameters:
header_name - Name of the header field to get.
Returns:
List of one or more header fields matching provided name.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getInputStream

public InputStream getInputStream()
Retrieves an input stream for this part's contents.
Returns:
Input stream of bytes.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSize

public int getSize()
Retrieves the size of this part's contents.
Returns:
Size of this part's contents in bytes.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isMimeType

public boolean isMimeType(String mimeType)
Determines if this part's contents are of the provided MIME content type.
Parameters:
mimeType - Name of the MIME type to match against this part's contents.
Returns:
True if this part's content-type matches your provided name; otherwise, false.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

removeHeader

public void removeHeader(String header_name)
Removes all header fields by name.
Parameters:
header_name - Name of the header fields to remove.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setContent

public void setContent(Object ch)
                throws MessagingException
Sets this part's contents.
Parameters:
ch - Object to use for this part's contents.
Throws:
MessagingException - To indicate a general messaging error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setHeader

public void setHeader(String header_name,
                      String header_value)
Sets the value for header field by name.
Parameters:
header_name - Name of the header field for which to set a value.
header_value - Value to set for the header field.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

writeTo

public void writeTo(OutputStream os)
             throws IOException
Writes this part's contents to a provided output stream.

Use this method to write out a byte stream of this part's contents, in a form suitable for mail transmission. The byte stream is typically an aggregation of the headers and body.

Parameters:
os - Output stream of bytes to write to.
Throws:
IOException - To signal that an I/O exception has occurred.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



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