Class w3c.mime.MIMEParser
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.mime.MIMEParser

java.lang.Object
   |
   +----w3c.mime.MIMEParser

public class MIMEParser
extends Object
The MIMEParser class parses an input MIME stream.

This parsing is done in two stages. In the first stage, only header names and header values (as String) are parsed. These informations are built into a MIMEHeader object which than parses header value according to some specific type.

You can use this class either directly, or subclass MIMEParser and MIMEHeader for example, to get HTTPParser and Request in the HTTP context, or MAILParser and MAILHeaders in SMTP context.

See Also:
MIMEHeaders

Variable Index

 o bsize
 o buffer
 o ch
 o input

Constructor Index

 o MIMEParser(InputStream)
Create an instance of the MIMEParser class.

Method Index

 o append(int)
 o expect(int)
 o getInputStream()
Get the message body, as an input stream.
 o getMIMEHeaders()
Get the set of headers defined in this MIME stream This method return a container for the headers encountered while parsing the stream.
 o main(String[])
Debug only.
 o parse822HeaderBody()
 o parse822HeaderName()
 o parse822Headers(Hashtable)
 o parseToken(boolean)
 o skipSpaces()

Variables

 o ch
  protected int ch
 o input
  protected InputStream input
 o buffer
  protected byte buffer[]
 o bsize
  protected int bsize

Constructors

 o MIMEParser
  public MIMEParser(InputStream input)
Create an instance of the MIMEParser class.
Parameters:
in - The input stream to be parsed as a MIME stream.

Methods

 o expect
  protected void expect(int car) throws MIMEParserException, IOException
 o skipSpaces
  protected void skipSpaces() throws MIMEParserException, IOException
 o append
  protected final void append(int c)
 o parse822HeaderName
  protected String parse822HeaderName() throws MIMEParserException, IOException
 o parse822HeaderBody
  protected String parse822HeaderBody() throws MIMEParserException, IOException
 o parseToken
  protected String parseToken(boolean lower) throws MIMEParserException, IOException
 o parse822Headers
  protected void parse822Headers(Hashtable into) throws MIMEParserException, IOException
 o getMIMEHeaders
  public MIMEHeaders getMIMEHeaders() throws MIMEException
Get the set of headers defined in this MIME stream This method return a container for the headers encountered while parsing the stream.
Throws: MIMEException
If the input stream couldn't be parsed.
 o getInputStream
  public BufferedInputStream getInputStream()
Get the message body, as an input stream. FIXME: I don't know if Request should implements IO interface (and hence check that the body and only the body gets read), or ...
 o main
  public static void main(String args[])
Debug only. Parse the given file name as a MIME stream.

All Packages  Class Hierarchy  This Package  Previous  Next  Index