Package org.apache.james.mime4j.descriptor

Examples of org.apache.james.mime4j.descriptor.MutableBodyDescriptor.addField()


        bd = newBodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boundary=yada yada");
        assertEquals("yada", bd.getBoundary());
       
        bd = newBodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boUNdarY= ya:*da; \tcharset\t =  big5");
        assertEquals("ya:*da", bd.getBoundary());
        assertEquals("big5", bd.getCharset());
       
        bd = newBodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boUNdarY= \"ya \\\"\\\"\tda \\\"\"; "
View Full Code Here


        bd.addField("Content-Type", "multipart/yada; boUNdarY= ya:*da; \tcharset\t =  big5");
        assertEquals("ya:*da", bd.getBoundary());
        assertEquals("big5", bd.getCharset());
       
        bd = newBodyDescriptor();
        bd.addField("Content-Type", "multipart/yada; boUNdarY= \"ya \\\"\\\"\tda \\\"\"; "
                            + "\tcharset\t =  \"\\\"hepp\\\"  =us\t-ascii\"");
        assertEquals("ya \"\"\tda \"", bd.getBoundary());
        assertEquals("\"hepp\"  =us\t-ascii", bd.getCharset());
       
    }
View Full Code Here

       
    }
   
    public void testDoDefaultToUsAsciiWhenUntyped() throws Exception {
        MutableBodyDescriptor descriptor = newBodyDescriptor();
        descriptor.addField("To", "me@example.org");
        assertEquals("us-ascii", descriptor.getCharset());
    }

    public void testDoNotDefaultToUsAsciiForNonTextTypes() throws Exception {
        MutableBodyDescriptor descriptor = newBodyDescriptor();
View Full Code Here

        assertEquals("us-ascii", descriptor.getCharset());
    }

    public void testDoNotDefaultToUsAsciiForNonTextTypes() throws Exception {
        MutableBodyDescriptor descriptor = newBodyDescriptor();
        descriptor.addField("Content-Type", "image/png; name=blob.png");
        assertNull(descriptor.getCharset());
    }
}
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.