org.brains2b.coffee.decode
Class MimeDecoder

java.lang.Object
  extended by org.brains2b.coffee.decode.MimeDecoder
All Implemented Interfaces:
Decoder

public class MimeDecoder
extends java.lang.Object
implements Decoder

Decode mime-encoded content

Will ignore everything that is text without a Content-Disposition and decodes other found content if it is Base64 or content-printable

Other Content-Types might be included in future releases

Version:
1.00 [Aug 11, 2005]
Author:
dennis@brains2b.nl

Constructor Summary
MimeDecoder()
           
 
Method Summary
 void decodePiece(java.lang.String s)
          hand a piece of coded characters to the Decoder
 FileMessage getFileMessage()
          get the FileMessage with a reference to the decoded bytes
 void setBoundary(java.lang.String boundary)
          set the boundary as supplied by the message in the header as ';boundary='
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeDecoder

public MimeDecoder()
Method Detail

decodePiece

public void decodePiece(java.lang.String s)
                 throws java.lang.Exception
Description copied from interface: Decoder
hand a piece of coded characters to the Decoder

Specified by:
decodePiece in interface Decoder
Parameters:
s - String, a piece or the complete encoded characters to decode
Throws:
java.lang.Exception
See Also:
Decoder.getFileMessage()

setBoundary

public void setBoundary(java.lang.String boundary)
set the boundary as supplied by the message in the header as ';boundary='

Value does not have to be set for the Decoder to work and often is not

Parameters:
boundary - String, the boundary between the content types
See Also:
ArticleHeader.getMimeType()

getFileMessage

public FileMessage getFileMessage()
                           throws java.lang.Exception
Description copied from interface: Decoder
get the FileMessage with a reference to the decoded bytes

Specified by:
getFileMessage in interface Decoder
Returns:
FileMessage the reference to the decoded bytes and possible file information
Throws:
java.lang.Exception