org.marre.mime.encoder
Class TextMimeEncoder

java.lang.Object
  extended byorg.marre.mime.encoder.TextMimeEncoder
All Implemented Interfaces:
MimeEncoder

public class TextMimeEncoder
extends java.lang.Object
implements MimeEncoder

Converts mime documents to text. TODO: Content-Transfer-Encoding.
TODO: Special handling of some headers like Content-Id.

Version:
$Id: TextMimeEncoder.java,v 1.1 2004/11/02 17:59:54 c95men Exp $
Author:
Markus Eriksson

Constructor Summary
TextMimeEncoder()
          Creates a TextMimeEncoder.
 
Method Summary
 void writeBody(java.io.OutputStream theOs, MimeBodyPart theMsg)
          Writes the body of the message to the given stream.
 void writeContentType(java.io.OutputStream theOs, MimeBodyPart theMsg)
          Writes the content-type of the message to the given stream.
protected  void writeHeader(java.io.OutputStream theOs, MimeHeader header)
          Write one header to the stream.
 void writeHeaders(java.io.OutputStream theOs, MimeBodyPart theMsg)
          Writes the headers of the message to the given stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextMimeEncoder

public TextMimeEncoder()
Creates a TextMimeEncoder.

Method Detail

writeContentType

public void writeContentType(java.io.OutputStream theOs,
                             MimeBodyPart theMsg)
                      throws java.io.IOException
Writes the content-type of the message to the given stream.

Specified by:
writeContentType in interface MimeEncoder
Parameters:
theOs - The stream to write to
theMsg - The message to get the content-type from
Throws:
java.io.IOException - Thrown if we fail to write the content-type to the stream

writeHeaders

public void writeHeaders(java.io.OutputStream theOs,
                         MimeBodyPart theMsg)
                  throws java.io.IOException
Writes the headers of the message to the given stream.

Specified by:
writeHeaders in interface MimeEncoder
Parameters:
theOs - The stream to write to
theMsg - The message to get the headers from
Throws:
java.io.IOException - Thrown if we fail to write the headers to the stream

writeBody

public void writeBody(java.io.OutputStream theOs,
                      MimeBodyPart theMsg)
               throws java.io.IOException
Writes the body of the message to the given stream.

Specified by:
writeBody in interface MimeEncoder
Parameters:
theOs - The stream to write to
theMsg - The message to get the data from
Throws:
java.io.IOException - Thrown if we fail to write the body to the stream

writeHeader

protected void writeHeader(java.io.OutputStream theOs,
                           MimeHeader header)
                    throws java.io.IOException
Write one header to the stream.

Parameters:
theOs - The stream to write to
header - The header to write.
Throws:
java.io.IOException - Thrown if we fail to write the header to the stream


Copyright © 2002-2005 Markus Eriksson. All Rights Reserved.