org.apache.james.mime4j.parser
Class MimeEntity

java.lang.Object
  extended by org.apache.james.mime4j.parser.AbstractEntity
      extended by org.apache.james.mime4j.parser.MimeEntity
All Implemented Interfaces:
EntityStateMachine

public class MimeEntity
extends AbstractEntity


Field Summary
 
Fields inherited from class org.apache.james.mime4j.parser.AbstractEntity
body, config, endState, log, parent, startState, state
 
Constructor Summary
MimeEntity(LineNumberSource lineSource, BufferedLineReaderInputStream inbuffer, BodyDescriptor parent, int startState, int endState)
           
MimeEntity(LineNumberSource lineSource, BufferedLineReaderInputStream inbuffer, BodyDescriptor parent, int startState, int endState, MimeEntityConfig config)
           
 
Method Summary
 EntityStateMachine advance()
          Advances the state machine to the next state in the process of the MIME stream parsing.
 java.io.InputStream getContentStream()
          Returns content stream of the entity body.
protected  LineReaderInputStream getDataStream()
           
protected  int getLineNumber()
          Returns the current line number or -1 if line number information is not available.
 int getRecursionMode()
           
 void setRecursionMode(int recursionMode)
          Sets the current recursion mode.
 void skipHeader(java.lang.String contentType)
           
 
Methods inherited from class org.apache.james.mime4j.parser.AbstractEntity
debug, getBodyDescriptor, getField, getState, message, monitor, newBodyDescriptor, parseField, stateToString, toString, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MimeEntity

public MimeEntity(LineNumberSource lineSource,
                  BufferedLineReaderInputStream inbuffer,
                  BodyDescriptor parent,
                  int startState,
                  int endState,
                  MimeEntityConfig config)

MimeEntity

public MimeEntity(LineNumberSource lineSource,
                  BufferedLineReaderInputStream inbuffer,
                  BodyDescriptor parent,
                  int startState,
                  int endState)
Method Detail

getRecursionMode

public int getRecursionMode()

setRecursionMode

public void setRecursionMode(int recursionMode)
Description copied from interface: EntityStateMachine
Sets the current recursion mode. The recursion mode specifies the approach taken to parsing parts. RecursionMode.M_RAW mode does not parse the part at all. RecursionMode.M_RECURSE mode recursively parses each mail when an message/rfc822 part is encounted; RecursionMode.M_NO_RECURSE does not.

See Also:
RecursionMode

skipHeader

public void skipHeader(java.lang.String contentType)

getLineNumber

protected int getLineNumber()
Description copied from class: AbstractEntity
Returns the current line number or -1 if line number information is not available.

Specified by:
getLineNumber in class AbstractEntity

getDataStream

protected LineReaderInputStream getDataStream()
Specified by:
getDataStream in class AbstractEntity

advance

public EntityStateMachine advance()
                           throws java.io.IOException,
                                  MimeException
Description copied from interface: EntityStateMachine
Advances the state machine to the next state in the process of the MIME stream parsing. This method may return an new state machine that represents an embedded entity, which must be parsed before the parsing process of the current entity can proceed.

Returns:
a state machine of an embedded entity, if encountered, null otherwise.
Throws:
java.io.IOException - if an I/O error occurs.
MimeException - if the message can not be processed due to the MIME specification violation.

getContentStream

public java.io.InputStream getContentStream()
Description copied from interface: EntityStateMachine
Returns content stream of the entity body.

Returns:
input stream


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.