com.sun.im.provider
Class DocumentConverter

java.lang.Object
  extended bycom.sun.im.provider.DocumentConverter

public abstract class DocumentConverter
extends java.lang.Object

Document converter base class. all documents attached to messages are processed by the document converter if one is configured. The processing may include modifications of the document. If the document is modified the modified version of it is attached to messages relayed to recipients. The converter may also chose to remove the attachment.


Constructor Summary
DocumentConverter()
           
 
Method Summary
 java.io.InputStream convert(java.lang.String filename, java.io.InputStream in)
          Convert a document attached to a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentConverter

public DocumentConverter()
Method Detail

convert

public java.io.InputStream convert(java.lang.String filename,
                                   java.io.InputStream in)
                            throws java.lang.Exception
Convert a document attached to a message. This method does nothing and simply returns the incoming stream. It needs to be overwritten by actual document converters.

Parameters:
filename - file name associated with this document. The filename may be a hint of the type of the document, but it is by no mean authoritative.
in - incoming document to convert, loaded as a byte array.
Returns:
a input stream to the converted document. return null to cause the attachment to be removed.
Throws:
java.lang.Exception - the document converter may throw an Exception. If so the exception is logged in the server log file and the message is not relayed to any recipients. The sender receives a negative delivery status.