Package org.apache.james.mime4j

Examples of org.apache.james.mime4j.BodyDescriptor.addField()


        bd = new BodyDescriptor();
        bd.addField("CONTENT-TYPE", "   x-app/yada ;  param = yada");
        assertEquals("x-app/yada", bd.getMimeType());
       
        bd = new BodyDescriptor();
        bd.addField("CONTENT-TYPE", "   yada");
        assertEquals("text/plain", bd.getMimeType());
       
        /*
         * Make sure that only the first Content-Type header added is used.
         */
 
View Full Code Here


       
        /*
         * Make sure that only the first Content-Type header added is used.
         */
        bd = new BodyDescriptor();
        bd.addField("Content-Type ", "text/plain");
        assertEquals("text/plain", bd.getMimeType());
        bd.addField("Content-Type ", "text/html");
        assertEquals("text/plain", bd.getMimeType());
       
        /*
 
View Full Code Here

         * Make sure that only the first Content-Type header added is used.
         */
        bd = new BodyDescriptor();
        bd.addField("Content-Type ", "text/plain");
        assertEquals("text/plain", bd.getMimeType());
        bd.addField("Content-Type ", "text/html");
        assertEquals("text/plain", bd.getMimeType());
       
        /*
         * Implicit mime types.
         */
 
View Full Code Here

         */
        BodyDescriptor child = null;
        BodyDescriptor parent = null;
       
        parent = new BodyDescriptor();
        parent.addField("Content-Type", "mutlipart/alternative; boundary=foo");
       
        child = new BodyDescriptor(parent);
        assertEquals("text/plain", child.getMimeType());
        child.addField("Content-Type", " child/type");
        assertEquals("child/type", child.getMimeType());
View Full Code Here

        assertEquals("text/plain", child.getMimeType());
        child.addField("Content-Type", " child/type");
        assertEquals("child/type", child.getMimeType());
       
        parent = new BodyDescriptor();
        parent.addField("Content-Type", "multipart/digest; boundary=foo");
       
        child = new BodyDescriptor(parent);
        assertEquals("message/rfc822", child.getMimeType());
        child.addField("Content-Type", " child/type");
        assertEquals("child/type", child.getMimeType());
View Full Code Here

        /*
         * Test charset.
         */
        bd = new BodyDescriptor();
        assertEquals("us-ascii", bd.getCharset());
        bd.addField("Content-Type ", "some/type; charset=ISO-8859-1");
        assertEquals("iso-8859-1", bd.getCharset());
       
        bd = new BodyDescriptor();
        assertEquals("us-ascii", bd.getCharset());
        bd.addField("Content-Type ", "some/type");
View Full Code Here

        bd.addField("Content-Type ", "some/type; charset=ISO-8859-1");
        assertEquals("iso-8859-1", bd.getCharset());
       
        bd = new BodyDescriptor();
        assertEquals("us-ascii", bd.getCharset());
        bd.addField("Content-Type ", "some/type");
        assertEquals("us-ascii", bd.getCharset());
       
        /*
         * Test boundary.
         */
 
View Full Code Here

       
        /*
         * Test boundary.
         */
        bd = new BodyDescriptor();
        bd.addField("Content-Type", "text/html; boundary=yada yada");
        assertNull(bd.getBoundary());

        bd = new BodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boundary=yada");
        assertEquals("yada", bd.getBoundary());
View Full Code Here

        bd = new BodyDescriptor();
        bd.addField("Content-Type", "text/html; boundary=yada yada");
        assertNull(bd.getBoundary());

        bd = new BodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boundary=yada");
        assertEquals("yada", bd.getBoundary());

        /*
         * Test some weird parameters.
         */
 
View Full Code Here

        /*
         * Test some weird parameters.
         */
        bd = new BodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boundary=yada yada");
        assertEquals("yada", bd.getBoundary());
       
        bd = new BodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boUNdarY= ya:*da; \tcharset\t =  big5");
        assertEquals("ya:*da", bd.getBoundary());
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.