Interface EntityStateMachine

  • All Known Implementing Classes:
    RawEntity

    public interface EntityStateMachine
    Represents the interal state of a MIME entity, which is being retrieved from an input stream by a MIME parser.
    • Method Detail

      • getState

        EntityState getState()
        Return the current state of the entity.
        Returns:
        current state
        See Also:
        EntityState
      • advance

        EntityStateMachine advance()
                            throws IOException,
                                   MimeException
        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:
        IOException - if an I/O error occurs.
        MimeException - if the message can not be processed due to the MIME specification violation.
      • getDecodedContentStream

        InputStream getDecodedContentStream()
                                     throws IllegalStateException
        Returns the decoded content stream of the entity body.
        Returns:
        input stream
        Throws:
        IllegalStateException - if the content stream cannot be obtained at the current stage of the parsing process.