|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.rim.blackberry.api.mail.BodyPart
|
+--net.rim.blackberry.api.mail.SupportedAttachmentPart
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.
| 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 | ||
|
SupportedAttachmentPart(Multipart parent)
Constructs a new attachment part with the specified multipart parent. |
|
|
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 | ||
|
Object |
getContent()
Retrieves the raw data contained in the attachment. |
|
String |
getContentType()
Retrieves the value of the CONTENT_TYPE header.
|
|
String |
getFilename()
Retrieves the filename (if any) associated with this attachment. |
|
InputStream |
getInputStream()
Not supported. |
|
String |
getName()
Retrieves the attachment filename. |
|
int |
getSize()
Retrieves the size of the attachment. |
|
void |
setContent(Object content)
Sets the attachment content, this will replace any existing content. |
|
void |
setContentType(String value)
Sets the CONTENT_TYPE header value.
|
|
void |
setFilename(String filename)
Sets the filename for this attachment. |
|
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 |
public SupportedAttachmentPart(Multipart parent)
parent - Existing multipart object to contain this attachment partMultipartpublic SupportedAttachmentPart(Multipart parent, String contentType, String filename, byte[] data)
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.| Method Detail |
public InputStream getInputStream()
net.rim.blackberry.api.mail.Partpublic String getContentType()
CONTENT_TYPE header.
getContentType in class BodyPartpublic void setContentType(String value)
CONTENT_TYPE header value.
setContentType in class BodyPartvalue - MIME type to set for the CONTENT_TYPE header.public String getFilename()
public void setFilename(String filename)
public void setContent(Object content)
content - Only a raw byte object is supported.public Object getContent()
public int getSize()
public void writeTo(OutputStream out) throws IOException
out - An output stream to which to write attachment data.public String getName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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.