All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.messaging.mime.MIMEMessagePart

java.lang.Object
   |
   +----netscape.messaging.mime.MIMEBodyPart
           |
           +----netscape.messaging.mime.MIMEMessagePart

public class MIMEMessagePart
extends MIMEBodyPart
implements Cloneable
The MIMEMessagePart class implements the MIME MessagePart Content Type.


Constructor Index

 o MIMEMessagePart()
Constructs a MIMEMessagePart object.
 o MIMEMessagePart(MIMEMessage)
Constructs a MIMEMessagePart object from the given MIMEMessage Object.

Method Index

 o clone()
Clones an instance of this MIMEMessagePart object.
 o deleteMessage()
Deletes the MIMEMessage that is the Body of this part.
 o getAllHeaders()
Returns all the headers in this Part as an array of Header objects.
 o getContentEncoding()
Returns value of Content-Transfer-Encoding of this MIME Part.
 o getContentType()
Returns Content-Type of this MIME Part.
 o getExtBodyHeader(String)
Returns the value of the specified header associated with External Body.
 o getMessage(boolean)
Returns the MIMEMessage that is the Body of this part.
 o putByteStream(OutputStream)
Outputs a byte-stream for this part with its MIME part headers and encoded body data.
 o setContentEncoding(int)
Sets Content-Transfer-Encoding of this MIME Part.
 o setExtBodyHeader(String, String)
Sets the headers associated with External Body, for external-body content-subtypes only.
 o setMessage(MIMEMessage, boolean)
Sets the specified message as the body of this part.

Constructors

 o MIMEMessagePart
 public MIMEMessagePart()
Constructs a MIMEMessagePart object. Default constructor for the MIMEMessagePart.

 o MIMEMessagePart
 public MIMEMessagePart(MIMEMessage msg) throws MIMEException
Constructs a MIMEMessagePart object from the given MIMEMessage Object.

Parameters:
msg - The message that should form the body of this part.
Throws: MIMEException
If msg is null.

Methods

 o getContentType
 public String getContentType()
Returns Content-Type of this MIME Part. Always returns the string "Message".

Overrides:
getContentType in class MIMEBodyPart
 o setContentEncoding
 public void setContentEncoding(int encoding) throws MIMEException
Sets Content-Transfer-Encoding of this MIME Part. Only BINARY, E7BIT, and E8BIT are applicable to MIMEMessagePart. Additionally, for message/partial and message/external-body, the MIME standard requires E7BIT encoding. It is possible to set encoding prior to setting the contentSubType. If a different value is specified, no error occurs; instead, this method will be overridden by the putByteStream() method.

Parameters:
encoding - Value that represents the encoding.
Throws: MIMEException
If the value is not one of BINARY, E7BIT or E8BIT
See Also:
BINARY, E7BIT, E8BIT
 o getContentEncoding
 public int getContentEncoding()
Returns value of Content-Transfer-Encoding of this MIME Part. -1 if none present.

See Also:
BINARY, E7BIT, E8BIT
 o setMessage
 public void setMessage(MIMEMessage msg,
                        boolean clone) throws MIMEException
Sets the specified message as the body of this part.

Parameters:
msg - Message to be set as body of this part.
clone - If false stores reference to passed object instead of cloning a copy.
Throws: MIMEException
If already set (or) can not be set.
 o getMessage
 public MIMEMessage getMessage(boolean clone) throws MIMEException
Returns the MIMEMessage that is the Body of this part.

Parameters:
clone - If false returns reference to the object instead of a cloned copy.
Throws: MIMEException
If no Message exists in body-data.
 o deleteMessage
 public void deleteMessage()
Deletes the MIMEMessage that is the Body of this part. Noop if no body was ever set.

 o setExtBodyHeader
 public void setExtBodyHeader(String name,
                              String value) throws MIMEException
Sets the headers associated with External Body, for external-body content-subtypes only. If already set, these headers are ignored for other subtypes (rfc822 and message-partial).

Parameters:
name - Name of the header field. Should not include ':'
value - Value of the header field to be added.
Throws: MIMEException
if either of name or value is null
 o getExtBodyHeader
 public String getExtBodyHeader(String name) throws MIMEException
Returns the value of the specified header associated with External Body. Applicable to external-body subtypes only. Returns NULL if the header is not present.

Parameters:
name - Name of the header field.
Throws: MIMEException
If name passed is a NULL.
 o getAllHeaders
 public Header[] getAllHeaders() throws MIMEException
Returns all the headers in this Part as an array of Header objects.

Throws: MIMEException
If no headers exist.
 o putByteStream
 public void putByteStream(OutputStream os) throws IOException, MIMEException
Outputs a byte-stream for this part with its MIME part headers and encoded body data.

Parameters:
os - OutputStream to write to.
Throws: IOException
If an IO error occurs.
Throws: MIMEException
If encoding error is detected.
 o clone
 public Object clone() throws CloneNotSupportedException
Clones an instance of this MIMEMessagePart object.

Throws: CloneNotSupportedException
If thrown by a constituent components.
Overrides:
clone in class MIMEBodyPart

All Packages  Class Hierarchy  This Package  Previous  Next  Index