com.mirrorworlds.lifestreams.mail.tnef
Interface TnefBuilder

All Known Implementing Classes:
TnefMessageBuilder

public interface TnefBuilder

Interface to build a Tnef Message from a Tnef Stream. The builder methods are invoked by a TnefStreamParser.

Version:
Feb 18, 2000 Lifestreams 1.5

Method Summary
 void addAttachment()
          This method is called by the parser when it encounters a TNEF attachment (start of attachment) sequence.
 TnefMessage getMessage()
          Returns the message build by this builder.
 void setAttachmentAttribute(int id, byte[] data)
          Sets Attachment Sequence attributes.
 void setContentTypes(TnefContentTypes contentTypes)
          Sets the TnefContentTypes manager.
 void setKey(int key)
          Sets the message key set defined in the TNEF stream.
 void setMessageAttribute(int id, byte[] data)
          Sets Message Sequence attributes.
 void setSignature(int signature)
          Sets the TNEF stream signature.
 void setTnefVersion(int version)
          Sets the TNEF version defined in the message stream.
 

Method Detail

setContentTypes

public void setContentTypes(TnefContentTypes contentTypes)
Sets the TnefContentTypes manager. The TnefContentTypes maps a filename or file extension to its corresponding (MIME) content-type.
Parameters:
contentTypes - content-type manager.

setSignature

public void setSignature(int signature)
                  throws java.io.IOException
Sets the TNEF stream signature. The expected signature is 223E9F78. (hex).
Parameters:
signature - TNEF stream signature.
Throws:
IO - Exception if the signature is incorrect.

setKey

public void setKey(int key)
Sets the message key set defined in the TNEF stream. The key is a 16 bit unsigned integer.
Parameters:
key - message key.

setTnefVersion

public void setTnefVersion(int version)
Sets the TNEF version defined in the message stream.
Parameters:
version - TNEF message stream version.

setMessageAttribute

public void setMessageAttribute(int id,
                                byte[] data)
Sets Message Sequence attributes. See TnefConstants class for list of possible attributes. The type of attribute (eg: String) can be identified via TnefConstants.getAttType(id) method.
Parameters:
id - TNEF Message Attribute mapped to MAPI.
data - data for the defined attributes.

setAttachmentAttribute

public void setAttachmentAttribute(int id,
                                   byte[] data)
Sets Attachment Sequence attributes. See TnefConstants class for list of possible attributes. The type of attribute (eg: String) can be identified via TnefConstants.getAttType(id) method.
Parameters:
id - TNEF Attachment Attribute mapped to MAPI.
data - data for the defined attributes.

addAttachment

public void addAttachment()
This method is called by the parser when it encounters a TNEF attachment (start of attachment) sequence.

getMessage

public TnefMessage getMessage()
Returns the message build by this builder.