james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1103501 - in /james/mime4j/trunk: core/src/main/java/org/apache/james/mime4j/parser/ core/src/main/java/org/apache/james/mime4j/stream/ core/src/test/java/org/apache/james/mime4j/parser/ dom/src/main/java/org/apache/james/mime4j/dom/ dom/s...
Date Sun, 15 May 2011 18:37:40 GMT
Author: olegk
Date: Sun May 15 18:37:39 2011
New Revision: 1103501

URL: http://svn.apache.org/viewvc?rev=1103501&view=rev
Log:
MIME4J-116: Groundwork to resolve duplicate parsing of header field: moved Field interface
back to core; RawField changed to implement Field; ContentHandler changed to accept Fields
instead of RawFields

Added:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/Field.java
      - copied, changed from r1103485, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/Field.java
Removed:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/Field.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/FieldRawData.java
Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/AbstractEntity.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/DefaultBodyDescriptor.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/EntityStateMachine.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MimeTokenStream.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MutableBodyDescriptor.java
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/RawField.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/TestHandler.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Header.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/ParsedField.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AbstractField.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/DefaultFieldParser.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractEntity.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractHeader.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MaximalBodyDescriptor.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeBuilder.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeWriter.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/SimpleContentHandler.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldTest.java
    james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
    james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/AbstractContentHandler.java
Sun May 15 18:37:39 2011
@@ -21,7 +21,7 @@ package org.apache.james.mime4j.parser;
 
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.stream.BodyDescriptor;
-import org.apache.james.mime4j.stream.RawField;
+import org.apache.james.mime4j.stream.Field;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -56,7 +56,7 @@ public abstract class AbstractContentHan
     public void epilogue(InputStream is) throws MimeException, IOException {
     }
     
-    public void field(RawField field) throws MimeException {
+    public void field(Field field) throws MimeException {
     }
     
     public void preamble(InputStream is) throws MimeException, IOException {

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/parser/ContentHandler.java
Sun May 15 18:37:39 2011
@@ -21,7 +21,7 @@ package org.apache.james.mime4j.parser;
 
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.stream.BodyDescriptor;
-import org.apache.james.mime4j.stream.RawField;
+import org.apache.james.mime4j.stream.Field;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -125,7 +125,7 @@ public interface ContentHandler {
      * @param rawField the MIME field.
      * @throws MimeException on processing errors
      */
-    void field(RawField rawField) throws MimeException;
+    void field(Field rawField) throws MimeException;
 
     /**
      * Called when there are no more header fields in a message or body part.

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/AbstractEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/AbstractEntity.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/AbstractEntity.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/AbstractEntity.java
Sun May 15 18:37:39 2011
@@ -47,7 +47,7 @@ abstract class AbstractEntity implements
     private int lineCount;
     private boolean endOfHeader;
     private int headerCount;
-    private RawField field;
+    private Field field;
 
     AbstractEntity(
             MimeEntityConfig config,
@@ -140,11 +140,12 @@ abstract class AbstractEntity implements
             fieldBuilder.reset();
             readRawField();
             try {
-                field = fieldBuilder.build();
-                if (field == null) {
+                RawField rawfield = fieldBuilder.build();
+                field = rawfield;
+                if (rawfield == null) {
                     continue;
                 }
-                if (field.getDelimiterIdx() != field.getName().length()) {
+                if (rawfield.getDelimiterIdx() != rawfield.getName().length()) {
                     monitor(Event.OBSOLETE_HEADER);
                 }
                 body.addField(field);
@@ -194,7 +195,7 @@ abstract class AbstractEntity implements
      * @throws IllegalStateException {@link #getState()} returns another
      *   value than {@link EntityState#T_FIELD}.
      */
-    public RawField getField() {
+    public Field getField() {
         switch (getState()) {
         case T_FIELD:
             return field;

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/DefaultBodyDescriptor.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/DefaultBodyDescriptor.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/DefaultBodyDescriptor.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/DefaultBodyDescriptor.java
Sun May 15 18:37:39 2011
@@ -101,7 +101,7 @@ public class DefaultBodyDescriptor imple
      * 
      * @param field the MIME field.
      */
-    public void addField(RawField field) throws MimeException {
+    public void addField(Field field) throws MimeException {
         String name = field.getName().toLowerCase(Locale.US);
         
         if (name.equals("content-transfer-encoding") && !contentTransferEncSet) {
@@ -131,9 +131,15 @@ public class DefaultBodyDescriptor imple
         }
     }
 
-    private void parseContentType(RawField field) throws MimeException {
+    private void parseContentType(Field field) throws MimeException {
         contentTypeSet = true;
-        RawBody body = RawFieldParser.DEFAULT.parseRawBody(field);
+        RawField rawfield;
+        if (field instanceof RawField) {
+            rawfield = ((RawField) field);
+        } else {
+            rawfield = new RawField(field.getName(), field.getBody());
+        }
+        RawBody body = RawFieldParser.DEFAULT.parseRawBody(rawfield);
         String main = body.getValue();
         Map<String, String> params = new HashMap<String, String>();
         for (NameValuePair nmp: body.getParams()) {

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/EntityStateMachine.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/EntityStateMachine.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/EntityStateMachine.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/EntityStateMachine.java
Sun May 15 18:37:39 2011
@@ -107,6 +107,6 @@ public interface EntityStateMachine {
      * @throws IllegalStateException if a header field cannot be
      *  obtained at the current stage of the parsing process. 
      */
-    RawField getField() throws IllegalStateException;
+    Field getField() throws IllegalStateException;
     
 }

Copied: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/Field.java (from
r1103485, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/Field.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/Field.java?p2=james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/Field.java&p1=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/Field.java&r1=1103485&r2=1103501&rev=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/Field.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/Field.java Sun May
15 18:37:39 2011
@@ -17,7 +17,9 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mime4j.dom.field;
+package org.apache.james.mime4j.stream;
+
+import org.apache.james.mime4j.util.ByteSequence;
 
 /**
  * Abstract MIME field.
@@ -38,4 +40,10 @@ public interface Field {
      */
     String getBody();
 
+    /**
+     * Gets original (raw) representation of the field, if available, 
+     * <code>null</code> otherwise.
+     */
+    ByteSequence getRaw();
+
 }

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MimeTokenStream.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MimeTokenStream.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MimeTokenStream.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MimeTokenStream.java
Sun May 15 18:37:39 2011
@@ -344,7 +344,7 @@ public class MimeTokenStream {
      * @throws IllegalStateException {@link #getState()} returns another
      *   value than {@link #T_FIELD}.
      */
-    public RawField getField() {
+    public Field getField() {
         return currentStateMachine.getField();
     }
     

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MutableBodyDescriptor.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MutableBodyDescriptor.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MutableBodyDescriptor.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/MutableBodyDescriptor.java
Sun May 15 18:37:39 2011
@@ -31,7 +31,7 @@ public interface MutableBodyDescriptor e
      * Adds a field to the body descriptor.
      * @param field the MIME field.
      */
-    void addField(RawField field) throws MimeException;
+    void addField(Field field) throws MimeException;
     
     MutableBodyDescriptor newChild();
 

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/RawField.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/RawField.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/RawField.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/stream/RawField.java Sun
May 15 18:37:39 2011
@@ -26,7 +26,7 @@ import org.apache.james.mime4j.util.Mime
 /**
  * The basic immutable MIME field.
  */
-public final class RawField {
+public final class RawField implements Field {
 
     private final ByteSequence raw;
     private final int delimiterIdx;

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/MimeStreamParserTest.java
Sun May 15 18:37:39 2011
@@ -29,7 +29,7 @@ import junit.framework.TestCase;
 import org.apache.james.mime4j.parser.AbstractContentHandler;
 import org.apache.james.mime4j.parser.MimeStreamParser;
 import org.apache.james.mime4j.stream.BodyDescriptor;
-import org.apache.james.mime4j.stream.RawField;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.ByteSequence;
 import org.apache.james.mime4j.util.ContentUtil;
 
@@ -92,7 +92,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
@@ -116,7 +116,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
@@ -140,7 +140,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
@@ -201,7 +201,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
@@ -250,7 +250,7 @@ public class MimeStreamParserTest extend
             }
 
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 fail("field shouldn't be called for empty stream");
             }
 
@@ -293,7 +293,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 fail("No fields should be reported");
             }
             @Override
@@ -324,7 +324,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
             @Override
@@ -352,7 +352,7 @@ public class MimeStreamParserTest extend
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
@@ -371,7 +371,7 @@ public class MimeStreamParserTest extend
         parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
-            public void field(RawField field) {
+            public void field(Field field) {
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/TestHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/TestHandler.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/TestHandler.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/parser/TestHandler.java
Sun May 15 18:37:39 2011
@@ -24,7 +24,7 @@ import java.io.InputStream;
 
 import org.apache.james.mime4j.parser.ContentHandler;
 import org.apache.james.mime4j.stream.BodyDescriptor;
-import org.apache.james.mime4j.stream.RawField;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.ContentUtil;
 
 /**
@@ -92,7 +92,7 @@ class TestHandler implements ContentHand
     public void startHeader() {
         sb.append("<header>\r\n");
     }
-    public void field(RawField field) {
+    public void field(Field field) {
         sb.append("<field>\r\n"
                 + escape(ContentUtil.decode(field.getRaw()))
                 + "</field>\r\n");

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Header.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Header.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Header.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Header.java Sun May 15
18:37:39 2011
@@ -22,7 +22,7 @@ package org.apache.james.mime4j.dom;
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.james.mime4j.dom.field.Field;
+import org.apache.james.mime4j.stream.Field;
 
 /**
  * The header of an entity (see RFC 2045).

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/ParsedField.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/ParsedField.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/ParsedField.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/field/ParsedField.java
Sun May 15 18:37:39 2011
@@ -19,6 +19,8 @@
 
 package org.apache.james.mime4j.dom.field;
 
+import org.apache.james.mime4j.stream.Field;
+
 
 public interface ParsedField extends Field {
 

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AbstractField.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AbstractField.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AbstractField.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/AbstractField.java
Sun May 15 18:37:39 2011
@@ -20,7 +20,6 @@
 package org.apache.james.mime4j.field;
 
 import org.apache.james.mime4j.codec.DecodeMonitor;
-import org.apache.james.mime4j.dom.field.FieldRawData;
 import org.apache.james.mime4j.dom.field.ParseException;
 import org.apache.james.mime4j.dom.field.ParsedField;
 import org.apache.james.mime4j.util.ByteSequence;
@@ -28,7 +27,7 @@ import org.apache.james.mime4j.util.Byte
 /**
  * The base class of all field classes.
  */
-public abstract class AbstractField implements ParsedField, FieldRawData {
+public abstract class AbstractField implements ParsedField {
 
     private final String name;
     private final String body;

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/DefaultFieldParser.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/DefaultFieldParser.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/DefaultFieldParser.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/DefaultFieldParser.java
Sun May 15 18:37:39 2011
@@ -23,6 +23,7 @@ import org.apache.james.mime4j.MimeExcep
 import org.apache.james.mime4j.codec.DecodeMonitor;
 import org.apache.james.mime4j.dom.field.FieldName;
 import org.apache.james.mime4j.dom.field.ParsedField;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.RawField;
 import org.apache.james.mime4j.stream.RawFieldParser;
 import org.apache.james.mime4j.util.ByteSequence;
@@ -57,7 +58,7 @@ public class DefaultFieldParser extends 
     public static ParsedField parse(
             final ByteSequence raw, 
             final DecodeMonitor monitor) throws MimeException {
-        RawField rawField = RawFieldParser.DEFAULT.parseField(raw);
+        Field rawField = RawFieldParser.DEFAULT.parseField(raw);
         return PARSER.parse(rawField.getName(), rawField.getBody(), raw, monitor);
     }
 
@@ -73,7 +74,7 @@ public class DefaultFieldParser extends 
      * @throws MimeException if the raw string cannot be split into field name and body.
      */
     public static ParsedField parse(
-            final RawField rawField, 
+            final Field rawField, 
             final DecodeMonitor monitor) throws MimeException {
         return PARSER.parse(rawField.getName(), rawField.getBody(), rawField.getRaw(), monitor);
     }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/field/Fields.java Sun May
15 18:37:39 2011
@@ -36,13 +36,13 @@ import org.apache.james.mime4j.dom.field
 import org.apache.james.mime4j.dom.field.ContentTransferEncodingField;
 import org.apache.james.mime4j.dom.field.ContentTypeField;
 import org.apache.james.mime4j.dom.field.DateTimeField;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.dom.field.FieldName;
 import org.apache.james.mime4j.dom.field.MailboxField;
 import org.apache.james.mime4j.dom.field.MailboxListField;
 import org.apache.james.mime4j.dom.field.ParsedField;
 import org.apache.james.mime4j.dom.field.UnstructuredField;
 import org.apache.james.mime4j.field.address.AddressFormatter;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.RawField;
 import org.apache.james.mime4j.util.MimeUtil;
 

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractEntity.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractEntity.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractEntity.java
Sun May 15 18:37:39 2011
@@ -34,8 +34,8 @@ import org.apache.james.mime4j.dom.TextB
 import org.apache.james.mime4j.dom.field.ContentDispositionField;
 import org.apache.james.mime4j.dom.field.ContentTransferEncodingField;
 import org.apache.james.mime4j.dom.field.ContentTypeField;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.dom.field.FieldName;
+import org.apache.james.mime4j.stream.Field;
 
 /**
  * MIME entity. An entity has a header and a body (see RFC 2045).

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractHeader.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractHeader.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractHeader.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractHeader.java
Sun May 15 18:37:39 2011
@@ -27,7 +27,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.james.mime4j.dom.Header;
-import org.apache.james.mime4j.dom.field.Field;
+import org.apache.james.mime4j.stream.Field;
 
 /**
  * The header of an entity (see RFC 2045).

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/AbstractMessage.java
Sun May 15 18:37:39 2011
@@ -33,11 +33,11 @@ import org.apache.james.mime4j.dom.addre
 import org.apache.james.mime4j.dom.address.MailboxList;
 import org.apache.james.mime4j.dom.field.AddressListField;
 import org.apache.james.mime4j.dom.field.DateTimeField;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.dom.field.FieldName;
 import org.apache.james.mime4j.dom.field.MailboxField;
 import org.apache.james.mime4j.dom.field.MailboxListField;
 import org.apache.james.mime4j.dom.field.UnstructuredField;
+import org.apache.james.mime4j.stream.Field;
 
 public abstract class AbstractMessage extends AbstractEntity implements Message {
 

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
Sun May 15 18:37:39 2011
@@ -30,10 +30,10 @@ import org.apache.james.mime4j.dom.Entit
 import org.apache.james.mime4j.dom.Header;
 import org.apache.james.mime4j.dom.Message;
 import org.apache.james.mime4j.dom.Multipart;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.parser.ContentHandler;
 import org.apache.james.mime4j.stream.BodyDescriptor;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.RawField;
 import org.apache.james.mime4j.util.ByteArrayBuffer;
 import org.apache.james.mime4j.util.ByteSequence;
@@ -103,7 +103,7 @@ class EntityBuilder implements ContentHa
     /**
      * @see org.apache.james.mime4j.parser.ContentHandler#field(RawField)
      */
-    public void field(RawField field) throws MimeException {
+    public void field(Field field) throws MimeException {
         expect(Header.class);
         Field parsedField = DefaultFieldParser.parse(field, monitor); 
         ((Header) stack.peek()).addField(parsedField);

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MaximalBodyDescriptor.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MaximalBodyDescriptor.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MaximalBodyDescriptor.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MaximalBodyDescriptor.java
Sun May 15 18:37:39 2011
@@ -39,6 +39,7 @@ import org.apache.james.mime4j.stream.De
 import org.apache.james.mime4j.stream.RawBody;
 import org.apache.james.mime4j.stream.MutableBodyDescriptor;
 import org.apache.james.mime4j.stream.NameValuePair;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.RawField;
 import org.apache.james.mime4j.stream.RawFieldParser;
 import org.apache.james.mime4j.util.MimeUtil;
@@ -119,7 +120,7 @@ public class MaximalBodyDescriptor exten
     }
 
     @Override
-    public void addField(RawField field) throws MimeException {
+    public void addField(Field field) throws MimeException {
         String name = field.getName().toLowerCase(Locale.US);;
         if (MimeUtil.MIME_HEADER_MIME_VERSION.equals(name) && !isMimeVersionSet)
{
             parseMimeVersion(field);
@@ -140,7 +141,7 @@ public class MaximalBodyDescriptor exten
         }
     }
     
-    private void parseMD5(final RawField field) {
+    private void parseMD5(final Field field) {
         String value = field.getBody();
         isContentMD5Set = true;
         if (value != null) {
@@ -148,7 +149,7 @@ public class MaximalBodyDescriptor exten
         }
     }
 
-    private void parseLocation(final RawField field) {
+    private void parseLocation(final Field field) {
         isContentLocationSet = true;
         String value = field.getBody();
         if (value != null) {
@@ -169,7 +170,7 @@ public class MaximalBodyDescriptor exten
         }
     }
     
-    private void parseLanguage(final RawField field) {
+    private void parseLanguage(final Field field) {
         isContentLanguageSet = true;
         String value = field.getBody();
         if (value != null) {
@@ -182,9 +183,15 @@ public class MaximalBodyDescriptor exten
         }
     }
 
-    private void parseContentDisposition(final RawField field) throws MimeException {
+    private void parseContentDisposition(final Field field) throws MimeException {
         isContentDispositionSet = true;
-        RawBody body = RawFieldParser.DEFAULT.parseRawBody(field);
+        RawField rawfield;
+        if (field instanceof RawField) {
+            rawfield = ((RawField) field);
+        } else {
+            rawfield = new RawField(field.getName(), field.getBody());
+        }
+        RawBody body = RawFieldParser.DEFAULT.parseRawBody(rawfield);
         Map<String, String> params = new HashMap<String, String>();
         for (NameValuePair nmp: body.getParams()) {
             String name = nmp.getName().toLowerCase(Locale.US);
@@ -242,7 +249,7 @@ public class MaximalBodyDescriptor exten
         return result;
     }
     
-    private void parseContentDescription(final RawField field) {
+    private void parseContentDescription(final Field field) {
         String value = field.getBody();
         if (value == null) {
             contentDescription = "";
@@ -252,7 +259,7 @@ public class MaximalBodyDescriptor exten
         isContentDescriptionSet = true;
     }
 
-    private void parseContentId(final RawField field) {
+    private void parseContentId(final Field field) {
         String value = field.getBody();
         if (value == null) {
             contentId = "";
@@ -262,7 +269,7 @@ public class MaximalBodyDescriptor exten
         isContentIdSet = true;
     }
 
-    private void parseMimeVersion(RawField field) {
+    private void parseMimeVersion(Field field) {
         final StringReader reader = new StringReader(field.getBody());
         final MimeVersionParser parser = new MimeVersionParser(reader);
         try {

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeBuilder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeBuilder.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeBuilder.java
Sun May 15 18:37:39 2011
@@ -32,13 +32,12 @@ import org.apache.james.mime4j.dom.Heade
 import org.apache.james.mime4j.dom.Message;
 import org.apache.james.mime4j.dom.Multipart;
 import org.apache.james.mime4j.dom.SingleBody;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.parser.AbstractContentHandler;
 import org.apache.james.mime4j.parser.MimeStreamParser;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.MimeEntityConfig;
 import org.apache.james.mime4j.stream.MutableBodyDescriptorFactory;
-import org.apache.james.mime4j.stream.RawField;
 
 /**
  * Utility class for copying message and parsing message elements.
@@ -212,8 +211,8 @@ public class MimeBuilder {
                 parser.stop();
             }
             @Override
-            public void field(RawField field) throws MimeException {
-                Field parsedField = DefaultFieldParser.parse(field.getRaw(), monitor); 
+            public void field(Field field) throws MimeException {
+                Field parsedField = DefaultFieldParser.parse(field, monitor); 
                 header.addField(parsedField);
             }
         });

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeWriter.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeWriter.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeWriter.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MimeWriter.java Sun
May 15 18:37:39 2011
@@ -31,9 +31,8 @@ import org.apache.james.mime4j.dom.Messa
 import org.apache.james.mime4j.dom.Multipart;
 import org.apache.james.mime4j.dom.SingleBody;
 import org.apache.james.mime4j.dom.field.ContentTypeField;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.dom.field.FieldName;
-import org.apache.james.mime4j.dom.field.FieldRawData;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.ByteArrayBuffer;
 import org.apache.james.mime4j.util.ByteSequence;
 import org.apache.james.mime4j.util.ContentUtil;
@@ -195,10 +194,7 @@ public class MimeWriter {
      *             if an I/O error occurs.
      */
     public void writeField(Field field, OutputStream out) throws IOException {
-        ByteSequence raw = null;
-        if (field instanceof FieldRawData) {
-            raw = ((FieldRawData) field).getRaw();
-        }
+        ByteSequence raw = field.getRaw();
         if (raw == null) {
             StringBuilder buf = new StringBuilder();
             buf.append(field.getName());

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/SimpleContentHandler.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/SimpleContentHandler.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/SimpleContentHandler.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/SimpleContentHandler.java
Sun May 15 18:37:39 2011
@@ -22,9 +22,9 @@ package org.apache.james.mime4j.message;
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.codec.DecodeMonitor;
 import org.apache.james.mime4j.dom.Header;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.parser.AbstractContentHandler;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.RawField;
 
 /**
@@ -68,8 +68,8 @@ public abstract class SimpleContentHandl
      * @see org.apache.james.mime4j.parser.AbstractContentHandler#field(RawField)
      */
     @Override
-    public final void field(RawField field) throws MimeException {
-        Field parsedField = DefaultFieldParser.parse(field.getRaw(), monitor); 
+    public final void field(Field field) throws MimeException {
+        Field parsedField = DefaultFieldParser.parse(field, monitor); 
         currHeader.addField(parsedField);
     }
 

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java (original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/HeaderTest.java Sun May
15 18:37:39 2011
@@ -23,10 +23,10 @@ import junit.framework.TestCase;
 
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.james.mime4j.dom.Header;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.message.HeaderImpl;
 import org.apache.james.mime4j.message.MimeWriter;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.ByteArrayBuffer;
 import org.apache.james.mime4j.util.ContentUtil;
 

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MessageParserTest.java
Sun May 15 18:37:39 2011
@@ -43,10 +43,10 @@ import org.apache.james.mime4j.dom.Body;
 import org.apache.james.mime4j.dom.Entity;
 import org.apache.james.mime4j.dom.Multipart;
 import org.apache.james.mime4j.dom.TextBody;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.field.FieldsTest;
 import org.apache.james.mime4j.message.MessageImpl;
 import org.apache.james.mime4j.message.MimeBuilder;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.stream.MimeEntityConfig;
 
 public class MessageParserTest extends TestCase {

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java
(original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/dom/MimeBuilderCopyTest.java
Sun May 15 18:37:39 2011
@@ -26,7 +26,6 @@ import org.apache.james.mime4j.dom.Body;
 import org.apache.james.mime4j.dom.Entity;
 import org.apache.james.mime4j.dom.Header;
 import org.apache.james.mime4j.dom.Multipart;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.field.DefaultFieldParser;
 import org.apache.james.mime4j.message.BasicBodyFactory;
 import org.apache.james.mime4j.message.BodyPart;
@@ -34,6 +33,7 @@ import org.apache.james.mime4j.message.H
 import org.apache.james.mime4j.message.MessageImpl;
 import org.apache.james.mime4j.message.MimeBuilder;
 import org.apache.james.mime4j.message.MultipartImpl;
+import org.apache.james.mime4j.stream.Field;
 
 import junit.framework.TestCase;
 

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldTest.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldTest.java (original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldTest.java Sun
May 15 18:37:39 2011
@@ -22,9 +22,9 @@ package org.apache.james.mime4j.field;
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.dom.field.ContentTransferEncodingField;
 import org.apache.james.mime4j.dom.field.ContentTypeField;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.dom.field.UnstructuredField;
 import org.apache.james.mime4j.field.DefaultFieldParser;
+import org.apache.james.mime4j.stream.Field;
 
 import junit.framework.TestCase;
 

Modified: james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java (original)
+++ james/mime4j/trunk/dom/src/test/java/org/apache/james/mime4j/field/FieldsTest.java Sun
May 15 18:37:39 2011
@@ -35,12 +35,11 @@ import org.apache.james.mime4j.dom.field
 import org.apache.james.mime4j.dom.field.ContentTransferEncodingField;
 import org.apache.james.mime4j.dom.field.ContentTypeField;
 import org.apache.james.mime4j.dom.field.DateTimeField;
-import org.apache.james.mime4j.dom.field.Field;
-import org.apache.james.mime4j.dom.field.FieldRawData;
 import org.apache.james.mime4j.dom.field.MailboxField;
 import org.apache.james.mime4j.dom.field.MailboxListField;
 import org.apache.james.mime4j.field.Fields;
 import org.apache.james.mime4j.field.address.AddressBuilder;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.ByteSequence;
 import org.apache.james.mime4j.util.ContentUtil;
 import org.apache.james.mime4j.util.MimeUtil;
@@ -386,11 +385,9 @@ public class FieldsTest extends TestCase
 
     public static String decode(Field f) throws IOException {
         String s = null;
-        if (f instanceof FieldRawData) {
-            ByteSequence raw = ((FieldRawData) f).getRaw();
-            if (raw != null) {
-                s = ContentUtil.decode(raw);
-            }
+        ByteSequence raw = f.getRaw();
+        if (raw != null) {
+            s = ContentUtil.decode(raw);
         }
         if (s == null) {
             StringBuilder buf = new StringBuilder();

Modified: james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java?rev=1103501&r1=1103500&r2=1103501&view=diff
==============================================================================
--- james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java
(original)
+++ james/mime4j/trunk/examples/src/main/java/org/apache/james/mime4j/samples/tree/MessageTree.java
Sun May 15 18:37:39 2011
@@ -52,12 +52,12 @@ import org.apache.james.mime4j.dom.addre
 import org.apache.james.mime4j.dom.field.AddressListField;
 import org.apache.james.mime4j.dom.field.ContentTypeField;
 import org.apache.james.mime4j.dom.field.DateTimeField;
-import org.apache.james.mime4j.dom.field.Field;
 import org.apache.james.mime4j.dom.field.UnstructuredField;
 import org.apache.james.mime4j.field.address.AddressFormatter;
 import org.apache.james.mime4j.message.BodyPart;
 import org.apache.james.mime4j.message.MessageImpl;
 import org.apache.james.mime4j.message.MimeBuilder;
+import org.apache.james.mime4j.stream.Field;
 
 /**
  * Displays a parsed Message in a window. The window will be divided into



Mime
View raw message