|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.mail.Part
public abstract class Part
The common base class for Messages and BodyParts. It models a MIME entity
(see http://www.ietf.org/rfc/rfc2045.txt
, par. 2.4) that defines header
attributes (beginning with "content-") and content body. An entity that is
also a Message has the standard non-MIME header fields whose meanings are
defined by RFC 2822
Field Summary | |
---|---|
static java.lang.String |
CONTENT_TRANSFER_ENCODING
RFC 2822 |
static java.lang.String |
CONTENT_TYPE
The MIME "Content-Type" header name |
protected java.lang.String |
contentType
The MIME type of this Part |
static java.lang.String |
ENC_7BIT
The MIME "7bit" content transfer encoding |
static java.lang.String |
ENC_8BIT
The MIME "8bit" content transfer encoding |
static java.lang.String |
ENC_B64
The MIME "base64" content transfer encoding |
static java.lang.String |
ENC_QP
The MIME "quoted-printable" content transfer encoding |
protected java.util.Hashtable |
headers
The headers of this Part |
static java.lang.String |
MULTIPART
The MIME "multipart" content type |
static java.lang.String |
MULTIPART_ALTERNATIVE
The MIME "multipart/mixed" content type |
static java.lang.String |
MULTIPART_MIXED
The MIME "multipart/mixed" content type |
protected java.lang.String |
size
The size of this Part |
static java.lang.String |
TEXT_PLAIN
The MIME "text/plain" content type |
Constructor Summary | |
---|---|
protected |
Part()
The default constructor |
Method Summary | |
---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Adds a new header to the list of headers. |
java.lang.String[] |
getAllHeaders()
Returns the list of headers stored in this Message object, as an array of String |
abstract java.lang.Object |
getContent()
Get the content of this Part. |
java.lang.String |
getContentType()
Gets the value of the Content-Type header attribute of this Message |
java.lang.String |
getHeader(java.lang.String name)
Returns the header name |
java.lang.String |
getSize()
|
boolean |
isMultipart()
Check if the MIME type of this Part is multipart/* |
boolean |
isText()
Check if the MIME type of this Part is text/* |
boolean |
isTextHtml()
Check if the MIME type of this Part is text/html |
boolean |
isTextPlain()
Check if the MIME type of this Part is text/plain |
void |
removeHeader(java.lang.String name)
Remove the header name from this message |
abstract void |
setContent(java.lang.Object content)
Sets the content of this Part. |
abstract void |
setContent(java.lang.Object content,
java.lang.String type)
Sets the content and the Content-type of this Part. |
void |
setContentType(java.lang.String type)
Set the MIME-type of this Part. |
void |
setHeader(java.lang.String name,
java.lang.String val)
Set the value of an header, replacing the old value, if any. |
void |
setSize(java.lang.String size)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONTENT_TYPE
public static final java.lang.String MULTIPART
public static final java.lang.String MULTIPART_MIXED
public static final java.lang.String MULTIPART_ALTERNATIVE
public static final java.lang.String TEXT_PLAIN
public static final java.lang.String CONTENT_TRANSFER_ENCODING
public static final java.lang.String ENC_7BIT
public static final java.lang.String ENC_8BIT
public static final java.lang.String ENC_B64
public static final java.lang.String ENC_QP
protected java.util.Hashtable headers
Part
protected java.lang.String contentType
Part
protected java.lang.String size
Part
Constructor Detail |
---|
protected Part()
Used only by subclasses for common initialization.
Method Detail |
---|
public void addHeader(java.lang.String name, java.lang.String value)
NOTE: This method is not yet implemented and must not be called.
TODO: support multiple headers?
name
- The name of the header attribute as described in the RFC 2822value
- The content for the attributepublic java.lang.String getHeader(java.lang.String name)
name
null
if not foundpublic java.lang.String[] getAllHeaders()
headers
public abstract java.lang.Object getContent()
public java.lang.String getContentType()
Message
public abstract void setContent(java.lang.Object content) throws MailException
MailException
public abstract void setContent(java.lang.Object content, java.lang.String type) throws MailException
MailException
public void setContentType(java.lang.String type)
type
- The value for the MIME type of this Part,
without the Content-type header attributes.public void setHeader(java.lang.String name, java.lang.String val)
name
- The name of the header attribute as described in the RFC 2822val
- The new content for the attributepublic void removeHeader(java.lang.String name)
name
from this message
name
- the name of the header to be removedpublic boolean isMultipart()
true
if the media type is multipart
public boolean isText()
true
if the media type is text
public boolean isTextPlain()
true
if the media type is text
and
the subtype plain
public boolean isTextHtml()
true
if the media type is text
and
the subtype html
public void setSize(java.lang.String size)
public java.lang.String getSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |