Package org.apache.james.mime4j.dom.field

Examples of org.apache.james.mime4j.dom.field.UnstructuredField


     * message or <code>null</code> if it is not present.
     *
     * @return the subject of this message.
     */
    public String getSubject() {
        UnstructuredField field = obtainField(FieldName.SUBJECT);
        if (field == null)
            return null;

        return field.getValue();
    }
View Full Code Here


import junit.framework.TestCase;

public class UnstructuredFieldTest extends TestCase {

    public void testGetBody() throws Exception {
        UnstructuredField f = null;

        f = (UnstructuredField) DefaultFieldParser.parse("Subject: Yada\r\n yada yada\r\n");
        assertEquals("Testing folding value 1", "Yada yada yada", f.getValue());

        f = (UnstructuredField) DefaultFieldParser.parse("Subject:  \r\n\tyada");
        assertEquals("Testing folding value 2", " \tyada", f.getValue());

        f = (UnstructuredField) DefaultFieldParser.parse("Subject:yada");
        assertEquals("Testing value without a leading ' '", "yada", f.getValue());
    }
View Full Code Here

     * message or <code>null</code> if it is not present.
     *
     * @return the subject of this message.
     */
    public String getSubject() {
        UnstructuredField field = obtainField(FieldName.SUBJECT);
        if (field == null)
            return null;

        return field.getValue();
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.dom.field.UnstructuredField

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.