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.
-
MIMEMessagePart()
- Constructs a MIMEMessagePart object.
-
MIMEMessagePart(MIMEMessage)
- Constructs a MIMEMessagePart object from the given MIMEMessage Object.
-
clone()
- Clones an instance of this MIMEMessagePart object.
-
deleteMessage()
- Deletes the MIMEMessage that is the Body of this part.
-
getAllHeaders()
- Returns all the headers in this Part as an array of Header objects.
-
getContentEncoding()
- Returns value of Content-Transfer-Encoding of this MIME Part.
-
getContentType()
- Returns Content-Type of this MIME Part.
-
getExtBodyHeader(String)
- Returns the value of the specified header associated with External Body.
-
getMessage(boolean)
- Returns the MIMEMessage that is the Body of this part.
-
putByteStream(OutputStream)
- Outputs a byte-stream for this part with its MIME part headers and encoded
body data.
-
setContentEncoding(int)
- Sets Content-Transfer-Encoding of this MIME Part.
-
setExtBodyHeader(String, String)
- Sets the headers associated with External Body, for external-body content-subtypes
only.
-
setMessage(MIMEMessage, boolean)
- Sets the specified message as the body of this part.
MIMEMessagePart
public MIMEMessagePart()
- Constructs a MIMEMessagePart object.
Default constructor for the MIMEMessagePart.
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.
getContentType
public String getContentType()
- Returns Content-Type of this MIME Part. Always returns the string "Message".
- Overrides:
- getContentType in class MIMEBodyPart
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
getContentEncoding
public int getContentEncoding()
- Returns value of Content-Transfer-Encoding of this MIME Part. -1 if none present.
- See Also:
- BINARY, E7BIT, E8BIT
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.
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.
deleteMessage
public void deleteMessage()
- Deletes the MIMEMessage that is the Body of this part.
Noop if no body was ever set.
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
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.
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.
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.
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