net.rim.blackberry.api.mail
Class SupportedAttachmentPart

java.lang.Object
  extended by net.rim.blackberry.api.mail.BodyPart
      extended by net.rim.blackberry.api.mail.SupportedAttachmentPart
All Implemented Interfaces:
Part
Direct Known Subclasses:
FileSupportedAttachmentPart

public class SupportedAttachmentPart
extends BodyPart

Represents an attachment part that has a corresponding viewer on the handheld, including registered third-party viewers.

Only attachment parts that have supported viewers or handlers on the handheld are instantiated as this object.

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
 
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 SupportedAttachmentPart(Multipart parent)
          Creates a new SupportedAttachmentPart instance with the provided parent.
Category: Signed SupportedAttachmentPart(Multipart parent, String contentType, String filename, byte[] data)
          Creates a new SupportedAttachmentPart instance with provided parent, content-type, and data.
 
Method Summary
Category: Signed  Object getContent()
          Retrieves the raw data contained in this attachment part.
Category: Signed  String getContentType()
          Retrieves the content-type for this attachment part.
Category: Signed  String getFilename()
          Retrieves the filename (if any) associated with this attachment part.
Category: Signed  InputStream getInputStream()
          Retrieves an input stream for this attachment part.
Category: Signed  String getName()
          Retrieves the filename for this attachment part.
Category: Signed  int getSize()
          Retrieves the size of this attachment part's data.
Category: Signed  void setContent(Object content)
          Sets the content for this attachment content
Category: Signed  void setContentType(String value)
          Sets the content-type for this attachment part.
Category: Signed  void setFilename(String filename)
          Sets the filename for this attachment part.
Category: Signed  void writeTo(OutputStream out)
          Writes the name and data of this attachment part to the provided output stream.
 
Methods inherited from class net.rim.blackberry.api.mail.BodyPart
addHeader, getAllHeaders, getHeader, getParent, hasMore, isMimeType, moreRequestSent, removeHeader, setHeader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

SupportedAttachmentPart

public SupportedAttachmentPart(Multipart parent)
Creates a new SupportedAttachmentPart instance with the provided parent.

Parameters:
parent - Existing multipart to act as this part's parent.
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

SupportedAttachmentPart

public SupportedAttachmentPart(Multipart parent,
                               String contentType,
                               String filename,
                               byte[] data)
Creates a new SupportedAttachmentPart instance with provided parent, content-type, and data.

Parameters:
parent - Existing multipart object to contain this attachment part.
contentType - MIME content-type of this attachment part.
filename - File name of this attachment.
data - Data contained in this attachment 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


Method Detail

getInputStream

public InputStream getInputStream()
Retrieves an input stream for this attachment part.

Returns:
Null; sub-classes need to implement this method to provide specific functionality.
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

getContentType

public String getContentType()
Retrieves the content-type for this attachment part.

Specified by:
getContentType in interface Part
Overrides:
getContentType in class BodyPart
Returns:
MIME content-type for this attachment 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

setContentType

public void setContentType(String value)
Sets the content-type for this attachment part.

Overrides:
setContentType in class BodyPart
Parameters:
value - New MIME content-type for this attachment 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

getFilename

public String getFilename()
Retrieves the filename (if any) associated with this attachment part.

Returns:
This attachment part's filename.
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

setFilename

public void setFilename(String filename)
Sets the filename for this attachment part.

Parameters:
filename - New filename for this attachment 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

setContent

public void setContent(Object content)
Sets the content for this attachment content

Parameters:
content - New content for this attachment part; only a raw byte object is supported.
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 the raw data contained in this attachment part.

Returns:
Raw bytes that make up the attachment 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

getSize

public int getSize()
Retrieves the size of this attachment part's data.

Returns:
Length of this attachment part's contained data in bytes.
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 the name and data of this attachment part to the provided output stream.

Specified by:
writeTo in interface Part
Overrides:
writeTo in class BodyPart
Parameters:
out - Output stream to which to write attachment data.
Throws:
IOException - If an I/O error 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

getName

public String getName()
Retrieves the filename for this attachment part.

Returns:
The name of the underlying attachment file. If the name is not set, the file name will be returned.
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





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.