net.rim.blackberry.api.mail
Class TextBodyPart

java.lang.Object
  extended by net.rim.blackberry.api.mail.BodyPart
      extended by net.rim.blackberry.api.mail.TextBodyPart
All Implemented Interfaces:
Part

public class TextBodyPart
extends BodyPart

Body part with "text/plain" content-type.

This class is used when creating a multipart message that includes a text/plain part.

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:
BlackBerry API 3.6.0

Nested Class Summary
 
Nested classes/interfaces inherited from class net.rim.blackberry.api.mail.BodyPart
BodyPart.ContentType
 
Field Summary
Category: Signed static String TEXT_PLAIN
          Deprecated. Use TextBodyPart.getTextPlainContentType().
 
Fields inherited from class net.rim.blackberry.api.mail.BodyPart
CONTENT_TYPE, CRLF, EMPTY, SEPARATOR
 
Fields inherited from interface net.rim.blackberry.api.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
Category: Signed TextBodyPart(Multipart multipart)
          Creates a new, emtpy TextBodyPart instance.
Category: Signed TextBodyPart(Multipart mp, String text)
          Creates a new TextBodyPart instance with provided contents.
 
Method Summary
Category: Signed  Object getContent()
          Retrieves this body part's contents.
Category: Signed  InputStream getInputStream()
          Retrieves a stream representation of this body part's contents.
Category: Signed  int getSize()
          Retrieves the length of this body part's contents.
Category: Signed static String getTextPlainContentType()
          Retrieves the text/plain content-type name as a string.
Category: Signed  boolean hasMore()
          Determines if more data for this body part is available on the server.
Category: Signed  void setContent(Object content)
          Sets this body part's contents.
Category: Signed  void writeTo(OutputStream out)
          Writes this body part's contents to an output stream.
 
Methods inherited from class net.rim.blackberry.api.mail.BodyPart
addHeader, getAllHeaders, getContentType, getHeader, getParent, isMimeType, moreRequestSent, removeHeader, setContentType, setHeader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

TEXT_PLAIN

public static String TEXT_PLAIN
Deprecated. Use TextBodyPart.getTextPlainContentType().
Text/plain (default) content type..

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:
BlackBerry API 3.6.0


Constructor Detail

TextBodyPart

public TextBodyPart(Multipart multipart)
Creates a new, emtpy TextBodyPart instance.

Parameters:
multipart - Multipart to contain the new text body part.
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:
BlackBerry API 3.6.0

TextBodyPart

public TextBodyPart(Multipart mp,
                    String text)
Creates a new TextBodyPart instance with provided contents.

Parameters:
mp - Multipart to contain the new text body part.
text - Text to use for body contents.
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:
BlackBerry API 3.6.0


Method Detail

getTextPlainContentType

public static String getTextPlainContentType()
Retrieves the text/plain content-type name as a string.

This value can change during execution, hence a method to retrieve it's value. Call this method when requesting the default content type to ensure you have the most up to date value.

Returns:
The text/plain content-type name as a string.
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:
BlackBerry API 4.0.0

getInputStream

public InputStream getInputStream()
Retrieves a stream representation of this body part's contents.

Returns:
Input stream containing this part's contents.
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:
BlackBerry API 3.6.0

setContent

public void setContent(Object content)
Sets this body part's contents.

Parameters:
content - Object to use as this part's contents; must be a String, or treatable as such.
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:
BlackBerry API 3.6.0

getContent

public Object getContent()
Retrieves this body part's contents.

Returns:
This body part's content in String form.
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:
BlackBerry API 3.6.0

getSize

public int getSize()
Retrieves the length of this body part's contents.

Returns:
Length of this body part's contents.
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:
BlackBerry API 3.6.0

writeTo

public void writeTo(OutputStream out)
             throws IOException
Writes this body part's contents to an output stream.

This method first writes two CRLF pairs to the output stream and then writes out this body part's contents as a raw list of bytes.

Specified by:
writeTo in interface Part
Overrides:
writeTo in class BodyPart
Parameters:
out - Output stream to receive this part's contents.
Throws:
IOException - If an I/O exception occurs.
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:
BlackBerry API 3.6.0

hasMore

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

Overrides:
hasMore in class BodyPart
Returns:
True if more data is available; otherwise, false.
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:
BlackBerry API 4.5.0





Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.