Package org.apache.james.mime4j.field

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


* @version $Id: UnstructuredFieldTest.java,v 1.2 2004/10/02 12:41:11 ntherning Exp $
*/
public class UnstructuredFieldTest extends TestCase {

    public void testGetBody() throws Exception {
        UnstructuredField f = null;
       
        f = (UnstructuredField) Field.parse("Subject: Yada\r\n yada yada\r\n");
        assertEquals("Testing folding value 1", "Yada yada yada", f.getValue());
       
        f = (UnstructuredField) Field.parse("Subject:  \r\n\tyada");
        assertEquals("Testing folding value 2", " \tyada", f.getValue());
       
        f = (UnstructuredField) Field.parse("Subject:yada");
        assertEquals("Testing value without a leading ' '", "yada", f.getValue());
    }
View Full Code Here


* @version $Id: UnstructuredFieldTest.java,v 1.2 2004/10/02 12:41:11 ntherning Exp $
*/
public class UnstructuredFieldTest extends TestCase {

    public void testGetBody() {
        UnstructuredField f = null;
       
        f = (UnstructuredField) Field.parse("Subject: Yada\r\n yada yada\r\n");
        assertEquals("Testing folding value 1", "Yada yada yada", f.getValue());
       
        f = (UnstructuredField) Field.parse("Subject:  \r\n\tyada");
        assertEquals("Testing folding value 2", " \tyada", f.getValue());
       
        f = (UnstructuredField) Field.parse("Subject:yada");
        assertEquals("Testing value without a leading ' '", "yada", f.getValue());
    }
View Full Code Here

import junit.framework.TestCase;

public class UnstructuredFieldTest extends TestCase {

    public void testGetBody() throws Exception {
        UnstructuredField f = null;
       
        f = (UnstructuredField) AbstractField.parse("Subject: Yada\r\n yada yada\r\n");
        assertEquals("Testing folding value 1", "Yada yada yada", f.getValue());
       
        f = (UnstructuredField) AbstractField.parse("Subject:  \r\n\tyada");
        assertEquals("Testing folding value 2", " \tyada", f.getValue());
       
        f = (UnstructuredField) AbstractField.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

          MailboxList mailboxList = fromField.getMailboxList();
          for (int i = 0; i < mailboxList.size(); ++i) {
                metadata.add(Metadata.AUTHOR, mailboxList.get(i).getDisplayString());           
          }
        } else if (fieldname.equalsIgnoreCase("Subject")) {
          UnstructuredField subjectField = (UnstructuredField) AbstractField.parse(field.getRaw());
            metadata.add(Metadata.SUBJECT, subjectField.getValue());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.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.