Package org.apache.james.mime4j.stream
Class RawEntity
- java.lang.Object
-
- org.apache.james.mime4j.stream.RawEntity
-
- All Implemented Interfaces:
EntityStateMachine
public class RawEntity extends java.lang.Object implements EntityStateMachine
Raw MIME entity. Such entities will not be parsed into elements by the parser. They are meant to be consumed as a raw data stream by the caller.
-
-
Field Summary
Fields Modifier and Type Field Description private EntityState
state
private java.io.InputStream
stream
-
Constructor Summary
Constructors Constructor Description RawEntity(java.io.InputStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityStateMachine
advance()
Advances the state machine to the next state in the process of the MIME stream parsing.BodyDescriptor
getBodyDescriptor()
This method has no effect and always returnsnull
.java.io.InputStream
getContentStream()
Returns raw data stream.java.io.InputStream
getDecodedContentStream()
Returns the decoded content stream of the entity body.RawField
getField()
This method has no effect and always returnsnull
.java.lang.String
getFieldName()
This method has no effect and always returnsnull
.java.lang.String
getFieldValue()
This method has no effect and always returnsnull
.EntityState
getState()
Return the current state of the entity.void
setRecursionMode(RecursionMode recursionMode)
This method has no effect.
-
-
-
Field Detail
-
stream
private final java.io.InputStream stream
-
state
private EntityState state
-
-
Method Detail
-
getState
public EntityState getState()
Description copied from interface:EntityStateMachine
Return the current state of the entity.- Specified by:
getState
in interfaceEntityStateMachine
- Returns:
- current state
- See Also:
EntityState
-
setRecursionMode
public void setRecursionMode(RecursionMode recursionMode)
This method has no effect.- Specified by:
setRecursionMode
in interfaceEntityStateMachine
- See Also:
RecursionMode
-
advance
public EntityStateMachine advance()
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.- Specified by:
advance
in interfaceEntityStateMachine
- Returns:
- a state machine of an embedded entity, if encountered,
null
otherwise.
-
getContentStream
public java.io.InputStream getContentStream()
Returns raw data stream.- Specified by:
getContentStream
in interfaceEntityStateMachine
- Returns:
- input stream
-
getBodyDescriptor
public BodyDescriptor getBodyDescriptor()
This method has no effect and always returnsnull
.- Specified by:
getBodyDescriptor
in interfaceEntityStateMachine
- Returns:
- body description
-
getField
public RawField getField()
This method has no effect and always returnsnull
.- Specified by:
getField
in interfaceEntityStateMachine
- Returns:
- header field
-
getFieldName
public java.lang.String getFieldName()
This method has no effect and always returnsnull
.
-
getFieldValue
public java.lang.String getFieldValue()
This method has no effect and always returnsnull
.
-
getDecodedContentStream
public java.io.InputStream getDecodedContentStream() throws java.lang.IllegalStateException
Description copied from interface:EntityStateMachine
Returns the decoded content stream of the entity body.- Specified by:
getDecodedContentStream
in interfaceEntityStateMachine
- Returns:
- input stream
- Throws:
java.lang.IllegalStateException
- if the content stream cannot be obtained at the current stage of the parsing process.- See Also:
EntityStateMachine.getDecodedContentStream()
-
-