Examples of StructuredFieldParser


Examples of org.apache.james.mime4j.field.structured.StructuredFieldParser

    private void parseLocation(final String value) {
        isContentLocationSet = true;
        if (value != null) {
            final StringReader stringReader = new StringReader(value);
            final StructuredFieldParser parser = new StructuredFieldParser(stringReader);
            parser.setFoldingPreserved(false);
            try {
                contentLocation = parser.parse();
            } catch (MimeException e) {
                contentLocationParseException = e;
            }
        }
    }
View Full Code Here

Examples of org.apache.james.mime4j.field.structured.parser.StructuredFieldParser

        parsed = true;
        String body = getBody();
        location = null;
        if (body != null) {
            StringReader stringReader = new StringReader(body);
            StructuredFieldParser parser = new StructuredFieldParser(stringReader);
            try {
                // From RFC2017 3.1
                /*
                 * Extraction of the URL string from the URL-parameter is even simpler:
                 * The enclosing quotes and any linear whitespace are removed and the
                 * remaining material is the URL string.
                 * Read more: http://www.faqs.org/rfcs/rfc2017.html#ixzz0aufO9nRL
                 */
                location = parser.parse().replaceAll("\\s", "");
            } catch (ParseException ex) {
                parseException = ex;
            }
        }
    }
View Full Code Here

Examples of org.apache.james.mime4j.field.structured.parser.StructuredFieldParser

        assertEquals("Fi(This is a comment)eld", parse("\"Fi(This is a comment)eld\""));
        assertEquals("Field Value", parse("Fi(This is a comment)eld (A (very (nested) )comment)Value"));
    }

    private String parse(String in) throws Exception {
        StructuredFieldParser parser = new StructuredFieldParser(new StringReader(in));
        parser.setFoldingPreserved(true);
        return parser.parse();
    }
View Full Code Here

Examples of org.apache.james.mime4j.field.structured.parser.StructuredFieldParser

        assertEquals("Fi(This is a comment)eld", parse("\"Fi(This is a comment)eld\""));
        assertEquals("Field Value", parse("Fi(This is a comment)eld (A (very (nested) )comment)Value"));
    }
   
    private String parse(String in) throws Exception {
        StructuredFieldParser parser = new StructuredFieldParser(new StringReader(in));
        parser.setFoldingPreserved(true);
        return parser.parse();
    }
View Full Code Here

Examples of org.apache.james.mime4j.field.structured.parser.StructuredFieldParser

    private void parseLocation(final String value) {
        isContentLocationSet = true;
        if (value != null) {
            final StringReader stringReader = new StringReader(value);
            final StructuredFieldParser parser = new StructuredFieldParser(stringReader);
            parser.setFoldingPreserved(false);
            try {
                contentLocation = parser.parse();
            } catch (MimeException e) {
                contentLocationParseException = e;
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.