net.rim.blackberry.api.mail
Class MimeBodyPart

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

public class MimeBodyPart
extends BodyPart

This class represents a MIME 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 4.5.0

Nested Class Summary
 
Nested classes/interfaces inherited from class net.rim.blackberry.api.mail.BodyPart
BodyPart.ContentType
 
Field Summary
 
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 MimeBodyPart(Multipart parent)
          Creates a new, empty MimeBodyPart instance.
 
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  boolean hasMore()
          Determines if more data for this body part is available on the server.
Category: Signed  void setContent(Object content)
          This method is implementation of Part.setContent(Object) interface method.
 
Methods inherited from class net.rim.blackberry.api.mail.BodyPart
addHeader, getAllHeaders, getContentType, getHeader, getParent, isMimeType, moreRequestSent, removeHeader, setContentType, setHeader, writeTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

MimeBodyPart

public MimeBodyPart(Multipart parent)
Creates a new, empty MimeBodyPart instance.

Parameters:
parent - 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 4.5.0


Method Detail

setContent

public void setContent(Object content)
This method is implementation of Part.setContent(Object) interface method. MimeBodyPart doesn't support assigning any content and it will throw an UnsupportedOperationException. To construct an email message the TextBodyPart, SupportedAttachmentPart classes should be used.

Parameters:
content - Object to use for this part's contents.
See Also:
Multipart.addBodyPart(BodyPart)
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

getContent

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

Returns:
This body part's content in Multipart object or 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.5.0

getSize

public int getSize()
Retrieves the length of this body part's contents. If the MimeBodyPart represents a Multipart object then its children parts should be queried for total size.

Returns:
Length of this body part's contents if known, -1 otherwise
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

getInputStream

public InputStream getInputStream()
Retrieves a stream representation of this body part's contents. If the MimeBodyPart represents a Multipart object then its children parts should be queried for the stream data.

Returns:
Input stream containing this part's contents if available, null otherwise
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

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.