Package org.apache.james.mime4j.stream

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


                return;
            }
            buf = ContentUtil.encode(body);
            pos = 0;
        }
        ParserCursor cursor = new ParserCursor(pos, buf.length());
        addressList = LenientAddressBuilder.DEFAULT.parseAddressList(buf, cursor);
    }
View Full Code Here


        }
    }

    public Mailbox parseMailbox(final String text) {
        ByteSequence raw = ContentUtil.encode(text);
        ParserCursor cursor = new ParserCursor(0, text.length());
        return parseMailbox(raw, cursor, null);
    }
View Full Code Here

        return new Group(name, mboxes);
    }

    public Group parseGroup(final String text) {
        ByteSequence raw = ContentUtil.encode(text);
        ParserCursor cursor = new ParserCursor(0, text.length());
        return parseGroup(raw, cursor);
    }
View Full Code Here

        }
    }

    public Address parseAddress(final String text) {
        ByteSequence raw = ContentUtil.encode(text);
        ParserCursor cursor = new ParserCursor(0, text.length());
        return parseAddress(raw, cursor, null);
    }
View Full Code Here

        return new AddressList(addresses, false);
    }

    public AddressList parseAddressList(final String text) {
        ByteSequence raw = ContentUtil.encode(text);
        ParserCursor cursor = new ParserCursor(0, text.length());
        return parseAddressList(raw, cursor);
    }
View Full Code Here

            }
            buf = ContentUtil.encode(body);
            pos = 0;
        }
        RawFieldParser parser = RawFieldParser.DEFAULT;
        ParserCursor cursor = new ParserCursor(pos, buf.length());
        String token = parser.parseValue(buf, cursor, null);
        StringBuilder sb = new StringBuilder(token.length());
        for (int i = 0; i < token.length(); i++) {
            char ch = token.charAt(i);
            if (!CharsetUtil.isWhitespace(ch)) {
View Full Code Here

                return;
            }
            buf = ContentUtil.encode(body);
            pos = 0;
        }
        ParserCursor cursor = new ParserCursor(pos, buf.length());
        mailbox = LenientAddressBuilder.DEFAULT.parseMailbox(buf, cursor, null);
    }
View Full Code Here

            }
            buf = ContentUtil.encode(body);
            pos = 0;
        }
        RawFieldParser parser = RawFieldParser.DEFAULT;
        ParserCursor cursor = new ParserCursor(pos, buf.length());
        for (;;) {
            String token = parser.parseToken(buf, cursor, DELIM);
            if (token.length() > 0) {
                languages.add(token);
            }
            if (cursor.atEnd()) {
                break;
            } else {
                pos = cursor.getPos();
                if (buf.byteAt(pos) == COMMA) {
                    cursor.updatePos(pos + 1);
                }
            }
        }
    }
View Full Code Here

            }
            buf = ContentUtil.encode(body);
            pos = 0;
        }
        RawFieldParser parser = RawFieldParser.DEFAULT;
        ParserCursor cursor = new ParserCursor(pos, buf.length());
        String token1 = parser.parseValue(buf, cursor, DELIM);
        try {
            major = Integer.parseInt(token1);
            if (major < 0) {
                major = 0;
            }
        } catch (NumberFormatException ex) {
        }
        if (!cursor.atEnd() && buf.byteAt(cursor.getPos()) == FULL_STOP) {
            cursor.updatePos(cursor.getPos() + 1);
        }
        String token2 = parser.parseValue(buf, cursor, null);
        try {
            minor = Integer.parseInt(token2);
            if (minor < 0) {
View Full Code Here

                return;
            }
            buf = ContentUtil.encode(body);
            pos = 0;
        }
        ParserCursor cursor = new ParserCursor(pos, buf.length());
        mailboxList = LenientAddressBuilder.DEFAULT.parseAddressList(buf, cursor).flatten();
    }
View Full Code Here

TOP

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

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.