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 EntityStatestateprivate java.io.InputStreamstream
-
Constructor Summary
Constructors Constructor Description RawEntity(java.io.InputStream stream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityStateMachineadvance()Advances the state machine to the next state in the process of the MIME stream parsing.BodyDescriptorgetBodyDescriptor()This method has no effect and always returnsnull.java.io.InputStreamgetContentStream()Returns raw data stream.java.io.InputStreamgetDecodedContentStream()Returns the decoded content stream of the entity body.RawFieldgetField()This method has no effect and always returnsnull.java.lang.StringgetFieldName()This method has no effect and always returnsnull.java.lang.StringgetFieldValue()This method has no effect and always returnsnull.EntityStategetState()Return the current state of the entity.voidsetRecursionMode(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:EntityStateMachineReturn the current state of the entity.- Specified by:
getStatein interfaceEntityStateMachine- Returns:
- current state
- See Also:
EntityState
-
setRecursionMode
public void setRecursionMode(RecursionMode recursionMode)
This method has no effect.- Specified by:
setRecursionModein interfaceEntityStateMachine- See Also:
RecursionMode
-
advance
public EntityStateMachine advance()
Description copied from interface:EntityStateMachineAdvances 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:
advancein interfaceEntityStateMachine- Returns:
- a state machine of an embedded entity, if encountered,
nullotherwise.
-
getContentStream
public java.io.InputStream getContentStream()
Returns raw data stream.- Specified by:
getContentStreamin interfaceEntityStateMachine- Returns:
- input stream
-
getBodyDescriptor
public BodyDescriptor getBodyDescriptor()
This method has no effect and always returnsnull.- Specified by:
getBodyDescriptorin interfaceEntityStateMachine- Returns:
- body description
-
getField
public RawField getField()
This method has no effect and always returnsnull.- Specified by:
getFieldin 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.IllegalStateExceptionDescription copied from interface:EntityStateMachineReturns the decoded content stream of the entity body.- Specified by:
getDecodedContentStreamin 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()
-
-