SHOW Signed

net.rim.blackberry.api.mail
Class SupportedAttachmentPart

java.lang.Object
  |
  +--net.rim.blackberry.api.mail.BodyPart
        |
        +--net.rim.blackberry.api.mail.SupportedAttachmentPart
All Implemented Interfaces:
Part

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


Inner classes inherited from class net.rim.blackberry.api.mail.BodyPart
BodyPart.ContentType
 
Fields inherited from class net.rim.blackberry.api.mail.BodyPart
_parent, CONTENT_TYPE, CRLF, EMPTY, SEPARATOR
 
Fields inherited from interface net.rim.blackberry.api.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
 Category: Signed SupportedAttachmentPart(Multipart parent)
          Constructs a new attachment part with the specified multipart parent.
 Category: Signed SupportedAttachmentPart(Multipart parent, String contentType, String filename, byte[] data)
          Constructs a new attachment part with the specified multipart parent, content type and data.
 
Method Summary
 Category: Signed  Object getContent()
          Retrieves the raw data contained in the attachment.
 Category: Signed  String getContentType()
          Retrieves the value of the CONTENT_TYPE header.
 Category: Signed  String getFilename()
          Retrieves the filename (if any) associated with this attachment.
 Category: Signed  InputStream getInputStream()
          Not supported.
 Category: Signed  String getName()
          Retrieves the attachment filename.
 Category: Signed  int getSize()
          Retrieves the size of the attachment.
 Category: Signed  void setContent(Object content)
          Sets the attachment content, this will replace any existing content.
 Category: Signed  void setContentType(String value)
          Sets the CONTENT_TYPE header value.
 Category: Signed  void setFilename(String filename)
          Sets the filename for this attachment.
 Category: Signed  void writeTo(OutputStream out)
          Writes the name and data of the attachment to the provided 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)
Constructs a new attachment part with the specified multipart parent.

Parameters:
parent - Existing multipart object to contain this attachment part
See Also:
Multipart
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.

SupportedAttachmentPart

public SupportedAttachmentPart(Multipart parent,
                               String contentType,
                               String filename,
                               byte[] data)
Constructs a new attachment part with the specified multipart 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 - A byte array of data.
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

getInputStream

public InputStream getInputStream()
Not supported.
Following copied from interface: net.rim.blackberry.api.mail.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.

getContentType

public String getContentType()
Retrieves the value of the CONTENT_TYPE header.

Overrides:
getContentType in class BodyPart
Returns:
The MIME type for this body 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.

setContentType

public void setContentType(String value)
Sets the CONTENT_TYPE header value.

Overrides:
setContentType in class BodyPart
Parameters:
value - MIME type to set for the CONTENT_TYPE header.
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.

getFilename

public String getFilename()
Retrieves the filename (if any) associated with this 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.

setFilename

public void setFilename(String filename)
Sets the filename for this attachment.
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.

setContent

public void setContent(Object content)
Sets the attachment content, this will replace any existing content.

Parameters:
content - Only a raw byte object is supported.
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 raw data contained in the attachment.

Returns:
Raw bytes that comprise the attachment data.
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 attachment.

Returns:
Total length of the 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.

writeTo

public void writeTo(OutputStream out)
             throws IOException
Writes the name and data of the attachment to the provided stream.

Overrides:
writeTo in class BodyPart
Parameters:
out - An output stream to which to write attachment data.
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.

getName

public String getName()
Retrieves the attachment filename.

Returns:
The name of the underlying attachment file.
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.