|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.hunnysoft.jmime.TnefDecoder
public class TnefDecoder
Utility class that performs TNEF container decoding.
TnefDecoder is a utility class that can decode a TNEF
container and extract any file attachments it contains.
The TNEF container is a Microsoft proprietary file format that is used by Microsoft Outlook and Microsoft Exchange to carry various properties associated with an email message. Normally, the TNEF container should not be attached to a message that is sent outside the Outlook and Exchange environment. However, if a Microsoft client or server is configured in a certain way, it can send a message that contains a TNEF container to an external Internet mail server. (For example, you can cause Outlook to attach a TNEF container by configuring it to send messages in RTF format.) The container appears as an attachment with the file name winmail.dat and MIME type application/ms-tnef.
A TNEF container may contain zero or more file attachments. You should not expect every TNEF container to contain a file attachment.
To use the class, you invoke the constructor, passing a
ByteString that contains the bytes of the TNEF container.
Then you call the decode() method to decode the container.
Finally, you call the method attachments() to get an array of
all the file attachments. Each attachment is represented by an
instance of TnefAttachment.
| Constructor Summary | |
|---|---|
TnefDecoder(ByteString bstr)
Constructor. |
|
| Method Summary | |
|---|---|
TnefAttachment[] |
attachments()
Gets a list of contained file attachments. |
void |
decode()
Decodes the TNEF container. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TnefDecoder(ByteString bstr)
This constructor takes a ByteString argument that contains the bytes of the TNEF container.
Note: Make sure the bytes you pass to the constructor are not encoded with base64. The constructor assumes that the bytes are the actual bytes of the TNEF container, with any transfer encoding removed.
bstr - the bytes of the TNEF container| Method Detail |
|---|
public TnefAttachment[] attachments()
Note: A TNEF container might not contain any file attachments. If there are no file attachments, then the method returns an array with size 0.
public void decode()
throws DecodeException
This method decodes the TNEF container to get any file attachments it contains.
After you call decode(), you can call attachments() to
get the collection of attachments.
If the decoding fails, the method throws a DecodeException.
DecodeException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||