Package org.apache.james.mime4j.descriptor

Examples of org.apache.james.mime4j.descriptor.MaximalBodyDescriptor


        assertTrue("Parser is maximal so body descriptor should be maximal", descriptor instanceof MaximalBodyDescriptor);
        return (MaximalBodyDescriptor) descriptor;
    }

    protected MutableBodyDescriptor newBodyDescriptor() {
        return new MaximalBodyDescriptor();
    }
View Full Code Here


    protected MutableBodyDescriptor newBodyDescriptor() {
        return new MaximalBodyDescriptor();
    }

    protected MutableBodyDescriptor newBodyDescriptor(BodyDescriptor parent) {
        return new MaximalBodyDescriptor(parent);
    }
View Full Code Here

     * information.
     */
    protected MutableBodyDescriptor newBodyDescriptor(BodyDescriptor pParent) {
        final MutableBodyDescriptor result;
        if (maximalBodyDescriptor) {
            result = new MaximalBodyDescriptor(pParent);
        } else {
            result = new DefaultBodyDescriptor(pParent);
        }
        return result;
    }
View Full Code Here

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void testMimeVersionDefault() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.RFC822_SIMPLE_BYTES);
        assertEquals(1, descriptor.getMimeMajorVersion());
        assertEquals(0, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
    }
View Full Code Here

        assertEquals(0, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
    }
   
    public void testMimeVersion() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_ASCII_COMMENT_IN_MIME_VERSION_BYTES);
        assertEquals(2, descriptor.getMimeMajorVersion());
        assertEquals(4, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
    }
View Full Code Here

        assertEquals(4, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
    }
   
    public void testContentId() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_8859_BYTES);
        assertEquals(1, descriptor.getMimeMajorVersion());
        assertEquals(0, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
        assertEquals(ExampleMail.CONTENT_ID, descriptor.getContentId());
    }
View Full Code Here

        assertNull(descriptor.getMimeVersionParseException());
        assertEquals(ExampleMail.CONTENT_ID, descriptor.getContentId());
    }

    public void testContentDescription() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_8859_BYTES);
        assertEquals(1, descriptor.getMimeMajorVersion());
        assertEquals(0, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
        assertEquals(ExampleMail.CONTENT_DESCRIPTION, descriptor.getContentDescription());
    }
View Full Code Here

        assertNull(descriptor.getMimeVersionParseException());
        assertEquals(ExampleMail.CONTENT_DESCRIPTION, descriptor.getContentDescription());
    }
   
    public void testMimeVersionHeaderBreak() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_ASCII_MIME_VERSION_SPANS_TWO_LINES_BYTES);
        assertEquals(4, descriptor.getMimeMajorVersion());
        assertEquals(1, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
    }
View Full Code Here

        assertEquals(1, descriptor.getMimeMinorVersion());
        assertNull(descriptor.getMimeVersionParseException());
    }
   
    public void testContentDispositionType() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_BASE64_LATIN1_BYTES);
        assertEquals("inline", descriptor.getContentDispositionType());
    }
View Full Code Here

        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_BASE64_LATIN1_BYTES);
        assertEquals("inline", descriptor.getContentDispositionType());
    }
   
    public void testContentDispositionTypeCaseConversion() throws Exception {
        MaximalBodyDescriptor descriptor = describe(ExampleMail.ONE_PART_MIME_BASE64_LATIN1_BYTES);
        assertEquals("Should be converted to lower case", "inline", descriptor.getContentDispositionType());
        assertNotNull(descriptor.getContentDispositionParameters());
        assertEquals(0, descriptor.getContentDispositionParameters().size());
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.descriptor.MaximalBodyDescriptor

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.