Package org.apache.james.mime4j.stream

Examples of org.apache.james.mime4j.stream.EntityState


            handler.endHeader();
        } else {
            mimeTokenStream.parse(instream);
        }
        OUTER: for (;;) {
            EntityState state = mimeTokenStream.getState();
            switch (state) {
                case T_BODY:
                    BodyDescriptor desc = mimeTokenStream.getBodyDescriptor();
                    InputStream bodyContent;
                    if (contentDecoding) {
View Full Code Here


    }

    private MaximalBodyDescriptor describe(byte[] mail, int zeroBasedPart) throws Exception {
        ByteArrayInputStream bias = new ByteArrayInputStream(mail);
        parser.parse(bias);
        EntityState state = parser.next();
        while (state != EntityState.T_END_OF_STREAM && zeroBasedPart>=0) {
            state = parser.next();
            if (state == EntityState.T_BODY) {
                --zeroBasedPart;
            }
View Full Code Here

    }

    private MaximalBodyDescriptor describe(byte[] mail) throws Exception {
        ByteArrayInputStream bias = new ByteArrayInputStream(mail);
        parser.parse(bias);
        EntityState state = parser.next();
        while (state != EntityState.T_BODY && state != EntityState.T_END_OF_STREAM)
        {
            state = parser.next();
        }
        assertEquals(EntityState.T_BODY, state);
View Full Code Here

    }
   
    private void moveToNextPart() {
        try {
            checkParserState(parser.next(), EntityState.T_END_BODYPART);
            EntityState state = parser.next();
            if (state == EntityState.T_EPILOGUE) {
                while (parser.next() != EntityState.T_END_MULTIPART) {
                    // Just loop
                }
            } else if (state != EntityState.T_START_BODYPART && state != EntityState.T_END_MULTIPART) {
View Full Code Here

    void releaseContent() throws IOException {
        switch (state) {
            case STATE_UNREAD:
                try {
                    EntityState state;
                    do {
                        state = parser.next();
                    } while (state != EntityState.T_START_BODYPART && state != EntityState.T_END_MULTIPART);
                } catch (MimeException ex) {
                    throw new OMException(ex);
View Full Code Here

    }
   
    private void moveToNextPart() {
        try {
            checkParserState(parser.next(), EntityState.T_END_BODYPART);
            EntityState state = parser.next();
            if (state == EntityState.T_EPILOGUE) {
                while (parser.next() != EntityState.T_END_MULTIPART) {
                    // Just loop
                }
            } else if (state != EntityState.T_START_BODYPART && state != EntityState.T_END_MULTIPART) {
View Full Code Here

    void releaseContent() throws IOException {
        switch (state) {
            case STATE_UNREAD:
                try {
                    EntityState state;
                    do {
                        state = parser.next();
                    } while (state != EntityState.T_START_BODYPART && state != EntityState.T_END_MULTIPART);
                } catch (MimeException ex) {
                    throw new OMException(ex);
View Full Code Here

            config.setMaxLineLen(-1);
            config.setMaxHeaderLen(-1);

            MimeTokenStream parser = new MimeTokenStream(config);            parser.parse(input);
            while (!result && parser.next() != EntityState.T_END_OF_STREAM) {
                final EntityState state = parser.getState();
                switch (state) {
                    case T_BODY:
                    case T_PREAMBLE:
                    case T_EPILOGUE:
                        result = checkBody(isCaseInsensitive, buffer, result,
View Full Code Here

            parser.setRecursionMode(RecursionMode.M_NO_RECURSE);
            parser.parse(bIn);
            final HeaderImpl header = new HeaderImpl();

            EntityState next = parser.next();
            while (next != EntityState.T_BODY && next != EntityState.T_END_OF_STREAM && next != EntityState.T_START_MULTIPART) {
                if (next == EntityState.T_FIELD) {
                    header.addField(parser.getField());
                }
                next = parser.next();
View Full Code Here

        parser.parse(in);
        topLevel = true;
    }

    private void skipToStartOfInner(int position) throws IOException, MimeException {
        final EntityState state = parser.next();
        switch (state) {
            case T_START_MULTIPART:
                break;
            case T_START_MESSAGE:
                break;
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.stream.EntityState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.