net.freeutils.tnef

Class Message

public class Message extends Object

The Message class encapsulates a TNEF message.

Since: 2003-04-25

Constructor Summary
Message()
Constructs an empty Message.
Message(TNEFInputStream in)
Constructs a Message using the given TNEFInputStream.
Method Summary
voidaddAttachment(Attachment attachment)
Adds an attachment to this message.
voidaddAttribute(Attr attr)
Adds an attribute to this message.
ListgetAttachments()
Gets the Message attachments.
AttrgetAttribute(int ID)
Gets a specific Message attribute.
ListgetAttributes()
Gets the Message attributes.
MAPIPropsgetMAPIProps()
Gets the Message MAPI properties.
StringgetOEMCodePage()
Gets the charset name corresponding to the {@code attOemCodepage} attribute.
protected voidread(TNEFInputStream in)
Reads all Message contents from the given TNEFInputStream.
voidsetAttachments(List attachments)
Sets the Message attachments.
voidsetAttributes(List attributes)
Sets the Message attributes.
StringtoString()
Returns a string representation of this object.

Constructor Detail

Message

public Message()
Constructs an empty Message.

Message

public Message(TNEFInputStream in)
Constructs a Message using the given TNEFInputStream.

Parameters: in the TNEFInputStream containing message data

Throws: IOException if an I/O error occurs

Method Detail

addAttachment

public void addAttachment(Attachment attachment)
Adds an attachment to this message.

Parameters: attachment an attachment to add to this message

addAttribute

public void addAttribute(Attr attr)
Adds an attribute to this message.

Parameters: attr an attribute to add to this message

getAttachments

public List getAttachments()
Gets the Message attachments.

Returns: the Message attachments

getAttribute

public Attr getAttribute(int ID)
Gets a specific Message attribute.

Parameters: ID the requested attribute ID

Returns: the requested Message attribute, or null if no such attribute exists

getAttributes

public List getAttributes()
Gets the Message attributes.

Returns: the Message attributes

getMAPIProps

public MAPIProps getMAPIProps()
Gets the Message MAPI properties.

Returns: the Message MAPI properties, or null of none exist

Throws: IOException if an I/O error occurs

getOEMCodePage

public String getOEMCodePage()
Gets the charset name corresponding to the {@code attOemCodepage} attribute.

Returns: the charset name, or null if the {@code attOemCodepage} attribute is invalid or does not exist

read

protected void read(TNEFInputStream in)
Reads all Message contents from the given TNEFInputStream.

Parameters: in the TNEFInputStream containing message data

Throws: IOException if an I/O error occurs

setAttachments

public void setAttachments(List attachments)
Sets the Message attachments.

Parameters: attachments the Message attachments

setAttributes

public void setAttributes(List attributes)
Sets the Message attributes.

Parameters: attributes the Message attributes

toString

public String toString()
Returns a string representation of this object.

Returns: a string representation of this object