james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1145308 [4/7] - in /james/mime4j/trunk: core/src/main/java/org/apache/james/mime4j/ core/src/main/java/org/apache/james/mime4j/codec/ core/src/main/java/org/apache/james/mime4j/io/ core/src/main/java/org/apache/james/mime4j/parser/ core/sr...
Date Mon, 11 Jul 2011 19:48:57 GMT
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=1145308&r1=1145307&r2=1145308&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 Mon Jul 11 19:48:50 2011
@@ -50,7 +50,7 @@ public class MimeStreamParserTest extend
         sb.append("After this line the body ends.\r\n");
         sb.append("\r\n");
         sb.append("--myboundary--\r\n");
-        
+
         StringBuilder epilogue = new StringBuilder();
         epilogue.append("Content-type: text/plain\r\n");
         epilogue.append("\r\n");
@@ -59,13 +59,13 @@ public class MimeStreamParserTest extend
         epilogue.append("\r\n");
         epilogue.append("--myboundary--\r\n");
         epilogue.append("This is still the epilogue.\r\n");
-        
+
         sb.append(epilogue.toString());
-        
+
         ByteArrayInputStream bais = new ByteArrayInputStream(sb.toString().getBytes("US-ASCII"));
-        
+
         final StringBuilder actual = new StringBuilder();
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -77,10 +77,10 @@ public class MimeStreamParserTest extend
             }
         });
         parser.parse(bais);
-        
+
         assertEquals(epilogue.toString(), actual.toString());
     }
-    
+
     public void testParseOneLineFields() throws Exception {
         StringBuilder sb = new StringBuilder();
         final LinkedList<String> expected = new LinkedList<String>();
@@ -88,7 +88,7 @@ public class MimeStreamParserTest extend
         sb.append(expected.getLast() + "\r\n");
         expected.add("Subject: A subject");
         sb.append(expected.getLast() + "\r\n");
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -96,23 +96,23 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
     }
-    
+
     public void testCRWithoutLFInHeader() throws Exception {
         /*
          * Test added because \r:s not followed by \n:s in the header would
-         * cause an infinite loop. 
+         * cause an infinite loop.
          */
         StringBuilder sb = new StringBuilder();
         final LinkedList<String> expected = new LinkedList<String>();
         expected.add("The-field: This field\r\rcontains CR:s\r\r"
                         + "not\r\n\tfollowed by LF");
         sb.append(expected.getLast() + "\r\n");
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -120,12 +120,12 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
     }
-    
+
     public void testParseMultiLineFields() throws Exception {
         StringBuilder sb = new StringBuilder();
         final LinkedList<String> expected = new LinkedList<String>();
@@ -136,7 +136,7 @@ public class MimeStreamParserTest extend
         sb.append(expected.getLast() + "\r\n");
         expected.add("Subject: A folded subject\r\n Line 2\r\n\tLine 3");
         sb.append(expected.getLast() + "\r\n");
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -144,12 +144,12 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
     }
-    
+
     public void testStop() throws Exception {
         final MimeStreamParser parser = new MimeStreamParser();
         TestHandler handler = new TestHandler() {
@@ -178,13 +178,13 @@ public class MimeStreamParserTest extend
                         + "<body>\r\n"
                         + "</body>\r\n"
                         + "</message>\r\n";
-        
+
         parser.parse(new ByteArrayInputStream(msg.getBytes()));
         String result = handler.sb.toString();
-        
+
         assertEquals(expected, result);
     }
-    
+
     /*
      * Tests that invalid fields are ignored.
      */
@@ -197,7 +197,7 @@ public class MimeStreamParserTest extend
         expected.add("Subject: A subject");
         sb.append(expected.getLast() + "\r\n");
         sb.append("A line which should be ignored\r\n");
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -205,9 +205,9 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
     }
 
@@ -221,14 +221,14 @@ public class MimeStreamParserTest extend
         expected.add("endHeader");
         expected.add("body");
         expected.add("endMessage");
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
             public void body(BodyDescriptor bd, InputStream is) {
                 assertEquals(expected.removeFirst(), "body");
             }
-            
+
             @Override
             public void endMultipart() {
                 fail("endMultipart shouldn't be called for empty stream");
@@ -274,12 +274,12 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), "startMessage");
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(new byte[0]));
-        
+
         assertEquals(0, expected.size());
     }
-    
+
     /*
      * Tests parsing of empty headers.
      */
@@ -287,9 +287,9 @@ public class MimeStreamParserTest extend
         StringBuilder sb = new StringBuilder();
         sb.append("\r\n");
         sb.append("The body is right here\r\n");
-        
+
         final StringBuilder body = new StringBuilder();
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -304,12 +304,12 @@ public class MimeStreamParserTest extend
                 }
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals("The body is right here\r\n", body.toString());
     }
-    
+
     /*
      * Tests parsing of empty body.
      */
@@ -320,7 +320,7 @@ public class MimeStreamParserTest extend
         sb.append(expected.getLast() + "\r\n");
         expected.add("Subject: A subject");
         sb.append(expected.getLast() + "\r\n\r\n");
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -332,12 +332,12 @@ public class MimeStreamParserTest extend
                 assertEquals(-1, is.read());
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
     }
-    
+
     /*
      * Tests that invalid fields are ignored.
      */
@@ -348,7 +348,7 @@ public class MimeStreamParserTest extend
         sb.append(expected.getLast() + "\r\n");
         expected.add("Subject: A subject");
         sb.append(expected.getLast());
-        
+
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -356,18 +356,18 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
-        
+
         sb = new StringBuilder();
         expected.clear();
         expected.add("From: some@one.com");
         sb.append(expected.getLast() + "\r\n");
         expected.add("Subject: A subject");
         sb.append(expected.getLast() + "\r\n");
-        
+
         parser = new MimeStreamParser();
         parser.setContentHandler(new AbstractContentHandler() {
             @Override
@@ -375,12 +375,12 @@ public class MimeStreamParserTest extend
                 assertEquals(expected.removeFirst(), decode(field.getRaw()));
             }
         });
-        
+
         parser.parse(new ByteArrayInputStream(sb.toString().getBytes()));
-        
+
         assertEquals(0, expected.size());
     }
-    
+
     public void testAutomaticContentDecoding() throws Exception {
         MimeStreamParser parser = new MimeStreamParser();
         parser.setContentDecoding(true);
@@ -412,15 +412,15 @@ public class MimeStreamParserTest extend
                         + "Who ate my cake?\n"
                         + "</body>\r\n"
                         + "</message>\r\n";
-        
+
         parser.parse(new ByteArrayInputStream(msg.getBytes()));
         String result = handler.sb.toString();
-        
+
         assertEquals(expected, result);
     }
-    
+
     protected String decode(ByteSequence byteSequence) {
         return ContentUtil.decode(byteSequence);
     }
-    
+
 }

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=1145308&r1=1145307&r2=1145308&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 Mon Jul 11 19:48:50 2011
@@ -45,14 +45,14 @@ class TestHandler implements ContentHand
         }
         return "" + c;
     }
-    
+
     private String escape(String s) {
         s = s.replaceAll("&", "&amp;");
         s = s.replaceAll(">", "&gt;");
         s = s.replaceAll("<", "&lt;");
         return s;
     }
-    
+
     public void epilogue(InputStream is) throws IOException {
         sb.append("<epilogue>\r\n");
         int b = 0;
@@ -110,4 +110,4 @@ class TestHandler implements ContentHand
     public void raw(InputStream is) throws IOException {
         MimeStreamParserExampleMessagesTest.fail("raw should never be called");
     }
-}
\ No newline at end of file
+}

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/DefaultFieldBuilderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/DefaultFieldBuilderTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/DefaultFieldBuilderTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/DefaultFieldBuilderTest.java Mon Jul 11 19:48:50 2011
@@ -133,4 +133,4 @@ public class DefaultFieldBuilderTest ext
         }
     }
 
-}
\ No newline at end of file
+}

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/FallbackBodyDescriptorBuilderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/FallbackBodyDescriptorBuilderTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/FallbackBodyDescriptorBuilderTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/FallbackBodyDescriptorBuilderTest.java Mon Jul 11 19:48:50 2011
@@ -27,7 +27,7 @@ public class FallbackBodyDescriptorBuild
         /*
          * Make sure that only the first Content-Type header added is used.
          */
-        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder(); 
+        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder();
         builder.addField(new RawField("Content-Type ", "text/plain; charset=ISO-8859-1"));
         BodyDescriptor bd = builder.build();
         assertEquals("text/plain", bd.getMimeType());
@@ -37,28 +37,28 @@ public class FallbackBodyDescriptorBuild
         assertEquals("text/plain", bd.getMimeType());
         assertEquals("ISO-8859-1", bd.getCharset());
     }
-    
+
     public void testGetMimeType() throws Exception {
-        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder(); 
+        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder();
         builder.addField(new RawField("Content-Type ", "text/PLAIN"));
         BodyDescriptor bd = builder.build();
         assertEquals("text/plain", bd.getMimeType());
-        
+
         builder.reset();
         builder.addField(new RawField("content-type", "   TeXt / html   "));
         bd = builder.build();
         assertEquals("text/html", bd.getMimeType());
-        
+
         builder.reset();
         builder.addField(new RawField("CONTENT-TYPE", "   x-app/yada ;  param = yada"));
         bd = builder.build();
         assertEquals("x-app/yada", bd.getMimeType());
-        
+
         builder.reset();
         builder.addField(new RawField("CONTENT-TYPE", "   yada"));
         bd = builder.build();
         assertEquals("text/plain", bd.getMimeType());
-        
+
         /*
          * Make sure that only the first Content-Type header added is used.
          */
@@ -69,7 +69,7 @@ public class FallbackBodyDescriptorBuild
         builder.addField(new RawField("Content-Type ", "text/html"));
         bd = builder.build();
         assertEquals("text/plain", bd.getMimeType());
-        
+
         /*
          * Implicit mime types.
          */
@@ -81,21 +81,21 @@ public class FallbackBodyDescriptorBuild
         child.addField(new RawField("Content-Type", " child/type"));
         bd = child.build();
         assertEquals("child/type", bd.getMimeType());
-        
+
         parent.reset();
         parent.addField(new RawField("Content-Type", "multipart/digest; boundary=foo"));
-        
+
         child = parent.newChild();
         bd = child.build();
         assertEquals("message/rfc822", bd.getMimeType());
         child.addField(new RawField("Content-Type", " child/type"));
         bd = child.build();
         assertEquals("child/type", bd.getMimeType());
-        
+
     }
-    
+
     public void testParameters() throws Exception {
-        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder(); 
+        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder();
         /*
          * Test charset.
          */
@@ -104,14 +104,14 @@ public class FallbackBodyDescriptorBuild
         builder.addField(new RawField("Content-Type ", "text/type; charset=ISO-8859-1"));
         bd = builder.build();
         assertEquals("ISO-8859-1", bd.getCharset());
-        
+
         builder.reset();
         bd = builder.build();
         assertEquals("us-ascii", bd.getCharset());
         builder.addField(new RawField("Content-Type ", "text/type"));
         bd = builder.build();
         assertEquals("us-ascii", bd.getCharset());
-        
+
         /*
          * Test boundary.
          */
@@ -131,11 +131,11 @@ public class FallbackBodyDescriptorBuild
         bd = builder.build();
         assertEquals("ya \"\"\tda \"", bd.getBoundary());
         assertEquals("\"hepp\"  =us\t-ascii", bd.getCharset());
-        
+
     }
-    
+
     public void testGetContentLength() throws Exception {
-        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder(); 
+        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder();
         BodyDescriptor bd = builder.build();
         assertEquals(-1, bd.getContentLength());
 
@@ -148,19 +148,19 @@ public class FallbackBodyDescriptorBuild
         bd = builder.build();
         assertEquals(9901, bd.getContentLength());
     }
-    
+
     public void testDoDefaultToUsAsciiWhenUntyped() throws Exception {
-        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder(); 
+        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder();
         builder.addField(new RawField("To", "me@example.org"));
         BodyDescriptor bd = builder.build();
         assertEquals("us-ascii", bd.getCharset());
     }
 
     public void testDoNotDefaultToUsAsciiForNonTextTypes() throws Exception {
-        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder(); 
+        BodyDescriptorBuilder builder = new FallbackBodyDescriptorBuilder();
         builder.addField(new RawField("Content-Type", "image/png; name=blob.png"));
         BodyDescriptor bd = builder.build();
         assertNull(bd.getCharset());
     }
-    
+
 }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/LenientFieldBuilderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/LenientFieldBuilderTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/LenientFieldBuilderTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/LenientFieldBuilderTest.java Mon Jul 11 19:48:50 2011
@@ -99,4 +99,4 @@ public class LenientFieldBuilderTest ext
         assertEquals("some stuff", field.getBody());
     }
 
-}
\ No newline at end of file
+}

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeStreamTokenMessageRfc822Test.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeStreamTokenMessageRfc822Test.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeStreamTokenMessageRfc822Test.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeStreamTokenMessageRfc822Test.java Mon Jul 11 19:48:50 2011
@@ -28,7 +28,7 @@ import org.apache.james.mime4j.ExampleMa
 public class MimeStreamTokenMessageRfc822Test extends TestCase {
 
     MimeTokenStream stream;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -40,7 +40,7 @@ public class MimeStreamTokenMessageRfc82
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testShouldParseMessageRFC822CorrectWithDefaultConfiguration() throws Exception {
         nextIs(EntityState.T_START_HEADER);
         nextIs(EntityState.T_FIELD);
@@ -62,7 +62,7 @@ public class MimeStreamTokenMessageRfc82
         nextIs(EntityState.T_END_MESSAGE);
         nextIs(EntityState.T_END_OF_STREAM);
     }
-    
+
     public void testShouldParseMessageRFC822CorrectWithNoRecurse() throws Exception {
         stream.setRecursionMode(RecursionMode.M_NO_RECURSE);
         nextIs(EntityState.T_START_HEADER);
@@ -77,7 +77,7 @@ public class MimeStreamTokenMessageRfc82
         nextIs(EntityState.T_END_MESSAGE);
         nextIs(EntityState.T_END_OF_STREAM);
     }
-    
+
     public void testShouldParseMessageRFC822CorrectWithFlat() throws Exception {
         stream.setRecursionMode(RecursionMode.M_FLAT);
         nextIs(EntityState.T_START_HEADER);
@@ -92,7 +92,7 @@ public class MimeStreamTokenMessageRfc82
         nextIs(EntityState.T_END_MESSAGE);
         nextIs(EntityState.T_END_OF_STREAM);
     }
-    
+
     private void nextIs(EntityState state) throws Exception {
         assertEquals(MimeTokenStream.stateToString(state), MimeTokenStream.stateToString(stream.next()));
     }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenEmbeddedMessageTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenEmbeddedMessageTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenEmbeddedMessageTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenEmbeddedMessageTest.java Mon Jul 11 19:48:50 2011
@@ -27,9 +27,9 @@ import junit.framework.TestCase;
 import org.apache.james.mime4j.ExampleMail;
 
 public class MimeTokenEmbeddedMessageTest extends TestCase {
-    
+
     MimeTokenStream stream;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -53,9 +53,9 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_START_MULTIPART);
-        
+
         nextIs(EntityState.T_PREAMBLE);
 
         // PART ONE
@@ -66,7 +66,7 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_BODY);
         checkInputStream("Rhubarb!\r\n");
         nextIs(EntityState.T_END_BODYPART);
-        
+
         // PART TWO
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -76,7 +76,7 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_BODY);
         checkInputStream("987654321AHPLA\r\n");
         nextIs(EntityState.T_END_BODYPART);
-        
+
         // PART THREE
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -106,10 +106,10 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_BODY);
         checkInputStream("CUSTARDCUSTARDCUSTARD\r\n");
         nextIs(EntityState.T_END_BODYPART);
-        nextIs(EntityState.T_END_MULTIPART);   
+        nextIs(EntityState.T_END_MULTIPART);
         nextIs(EntityState.T_END_MESSAGE);
         nextIs(EntityState.T_END_BODYPART);
-        
+
         // PART FOUR
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -124,8 +124,8 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_END_MESSAGE);
         nextIs(EntityState.T_END_OF_STREAM);
     }
-    
-    
+
+
     public void testWhenFlatAtStartShouldIgnoreMultipartStructure() throws Exception {
         stream.setRecursionMode(RecursionMode.M_FLAT);
         nextIs(EntityState.T_START_HEADER);
@@ -135,14 +135,14 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_BODY);
-        
+
         checkInputStream(ExampleMail.MIME_MULTIPART_EMBEDDED_MESSAGES_BODY);
-        
+
         nextIs(EntityState.T_END_MESSAGE);
     }
-    
+
     public void testWhenFlatShouldIgnoreInnerMailsAndInnerMultiparts() throws Exception {
         nextIs(EntityState.T_START_HEADER);
         nextIs(EntityState.T_FIELD);
@@ -151,9 +151,9 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_START_MULTIPART);
-        
+
         stream.setRecursionMode(RecursionMode.M_FLAT);
         nextIs(EntityState.T_PREAMBLE);
 
@@ -165,7 +165,7 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_BODY);
         checkInputStream("Rhubarb!\r\n");
         nextIs(EntityState.T_END_BODYPART);
-        
+
         // PART TWO
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -175,7 +175,7 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_BODY);
         checkInputStream("987654321AHPLA\r\n");
         nextIs(EntityState.T_END_BODYPART);
-        
+
         // PART THREE
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -184,7 +184,7 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_BODY);
         checkInputStream(ExampleMail.MIME_MULTIPART_EMBEDDED_MESSAGES_INNER_MAIL);
         nextIs(EntityState.T_END_BODYPART);
-        
+
         // PART FOUR
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -196,7 +196,7 @@ public class MimeTokenEmbeddedMessageTes
         nextIs(EntityState.T_EPILOGUE);
         nextIs(EntityState.T_END_MULTIPART);
     }
-    
+
     private void checkInputStream(String expected) throws Exception {
         InputStream inputStream = stream.getInputStream();
         int next = inputStream.read();
@@ -207,7 +207,7 @@ public class MimeTokenEmbeddedMessageTes
         }
         assertEquals(expected.length(), i);
     }
-    
+
     private void nextIs(EntityState state) throws Exception {
         assertEquals(MimeTokenStream.stateToString(state), MimeTokenStream.stateToString(stream.next()));
     }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenNoRecurseTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenNoRecurseTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenNoRecurseTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenNoRecurseTest.java Mon Jul 11 19:48:50 2011
@@ -61,9 +61,9 @@ public class MimeTokenNoRecurseTest exte
             "Last part is plain text\r\n" +
             "--1729--\r\n" +
             "The End";
-    
+
     MimeTokenStream stream;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -88,13 +88,13 @@ public class MimeTokenNoRecurseTest exte
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_START_MULTIPART);
         nextIs(EntityState.T_PREAMBLE);
         nextShouldBeStandardPart(false);
-        
+
         nextShouldBeStandardPart(true);
-        
+
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
         nextIs(EntityState.T_FIELD);
@@ -117,7 +117,7 @@ public class MimeTokenNoRecurseTest exte
         nextIs(EntityState.T_EPILOGUE);
         nextIs(EntityState.T_END_MULTIPART);
     }
-    
+
 
     public void testWhenRecurseShouldTreatInnerMailAsAnyOtherPart() throws Exception {
         stream.setRecursionMode(RecursionMode.M_NO_RECURSE);
@@ -129,18 +129,18 @@ public class MimeTokenNoRecurseTest exte
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_START_MULTIPART);
         nextIs(EntityState.T_PREAMBLE);
         nextShouldBeStandardPart(false);
-        
+
         nextShouldBeStandardPart(true);
         nextShouldBeStandardPart(true);
         nextShouldBeStandardPart(true);
         nextIs(EntityState.T_EPILOGUE);
         nextIs(EntityState.T_END_MULTIPART);
     }
-    
+
     public void testWhenNoRecurseInputStreamShouldContainInnerMail() throws Exception {
         stream.setRecursionMode(RecursionMode.M_NO_RECURSE);
         nextIs(EntityState.T_START_HEADER);
@@ -151,11 +151,11 @@ public class MimeTokenNoRecurseTest exte
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_START_MULTIPART);
         nextIs(EntityState.T_PREAMBLE);
         nextShouldBeStandardPart(false);
-        
+
         nextShouldBeStandardPart(true);
         nextIs(EntityState.T_START_BODYPART);
         nextIs(EntityState.T_START_HEADER);
@@ -171,7 +171,7 @@ public class MimeTokenNoRecurseTest exte
         }
         assertEquals(INNER_MAIL.length()-2, i);
     }
-    
+
     public void testSetNoRecurseSoInputStreamShouldContainInnerMail() throws Exception {
         nextIs(EntityState.T_START_HEADER);
         nextIs(EntityState.T_FIELD);
@@ -181,11 +181,11 @@ public class MimeTokenNoRecurseTest exte
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_FIELD);
         nextIs(EntityState.T_END_HEADER);
-        
+
         nextIs(EntityState.T_START_MULTIPART);
         nextIs(EntityState.T_PREAMBLE);
         nextShouldBeStandardPart(false);
-        
+
         nextShouldBeStandardPart(true);
         stream.setRecursionMode(RecursionMode.M_NO_RECURSE);
         nextIs(EntityState.T_START_BODYPART);
@@ -213,7 +213,7 @@ public class MimeTokenNoRecurseTest exte
         nextIs(EntityState.T_BODY);
         nextIs(EntityState.T_END_BODYPART);
     }
-    
+
     private void nextIs(EntityState state) throws Exception {
         assertEquals(MimeTokenStream.stateToString(state), MimeTokenStream.stateToString(stream.next()));
     }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamBodyDescriptorTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamBodyDescriptorTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamBodyDescriptorTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamBodyDescriptorTest.java Mon Jul 11 19:48:50 2011
@@ -28,7 +28,7 @@ import org.apache.james.mime4j.ExampleMa
 public class MimeTokenStreamBodyDescriptorTest extends TestCase {
 
     MimeTokenStream parser;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -56,7 +56,7 @@ public class MimeTokenStreamBodyDescript
         assertEquals("1729", descriptor.getBoundary());
         assertEquals( "multipart/alternative", descriptor.getMimeType());
     }
-    
+
     public void testShouldReturnValidDescriptorForEpilogue() throws Exception {
         assertEquals(MimeTokenStream.stateToString(EntityState.T_START_HEADER), MimeTokenStream.stateToString(parser.next()));
         assertEquals(MimeTokenStream.stateToString(EntityState.T_FIELD), MimeTokenStream.stateToString(parser.next()));

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamReaderTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamReaderTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamReaderTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamReaderTest.java Mon Jul 11 19:48:50 2011
@@ -31,9 +31,9 @@ import org.apache.james.mime4j.ExampleMa
 import org.apache.james.mime4j.MimeException;
 
 public class MimeTokenStreamReaderTest extends TestCase {
-    
+
     MimeTokenStream parser;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -62,25 +62,25 @@ public class MimeTokenStreamReaderTest e
         String body = ExampleMail.ONE_PART_MIME_8859_BODY;
         checkSimpleMail(bytes, body, 13);
     }
-    
+
     public void testShouldReadOnePartMimeBase64ASCIIBody() throws Exception {
         byte[] bytes = ExampleMail.ONE_PART_MIME_BASE64_ASCII_BYTES;
         String body = ExampleMail.ONE_PART_MIME_BASE64_ASCII_BODY;
         checkSimpleMail(bytes, body, 11);
     }
-    
+
     public void testShouldReadOnePartMimeBase64Latin1Body() throws Exception {
         byte[] bytes = ExampleMail.ONE_PART_MIME_BASE64_LATIN1_BYTES;
         String body = ExampleMail.ONE_PART_MIME_BASE64_LATIN1_BODY;
         checkSimpleMail(bytes, body, 11);
     }
-    
+
     public void testShouldReadOnePartMimeQuotedPrintable() throws Exception {
         byte[] bytes = ExampleMail.ONE_PART_MIME_QUOTED_PRINTABLE_ASCII_BYTES;
         String body = ExampleMail.ONE_PART_MIME_QUOTED_PRINTABLE_ASCII_BODY;
         checkSimpleMail(bytes, body, 11);
     }
-    
+
     public void testShouldReadPartBodies() throws IOException, MimeException {
         InputStream in = new ByteArrayInputStream(ExampleMail.MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_BYTES);
         parser.parse(in);
@@ -116,9 +116,9 @@ public class MimeTokenStreamReaderTest e
         checkBody(ExampleMail.MIME_MIXED_MULTIPART_VARIOUS_ENCODINGS_BASE64);
         assertEquals(MimeTokenStream.stateToString(EntityState.T_END_BODYPART),MimeTokenStream.stateToString(parser.next()));
 
-        
+
     }
-    
+
     private void checkSimpleMail(byte[] bytes, String body, int fields) throws IOException, MimeException {
         InputStream in = new ByteArrayInputStream(bytes);
         parser.parse(in);

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MimeTokenStreamTest.java Mon Jul 11 19:48:50 2011
@@ -28,12 +28,12 @@ import org.apache.james.mime4j.ExampleMa
 public class MimeTokenStreamTest extends TestCase {
 
     MimeTokenStream stream;
-    
+
     @Override
     public void setUp() throws Exception {
         stream = new MimeTokenStream();
     }
-    
+
     public void testSetRecursionModeBeforeParse() throws Exception {
         stream.setRecursionMode(RecursionMode.M_NO_RECURSE);
         stream.parse(new ByteArrayInputStream(ExampleMail.MAIL_WITH_RFC822_PART_BYTES));
@@ -75,8 +75,8 @@ public class MimeTokenStreamTest extends
         checkNextIs(EntityState.T_END_MESSAGE);
         checkNextIs(EntityState.T_END_OF_STREAM);
     }
-    
+
     private void checkNextIs(EntityState expected) throws Exception {
-        assertEquals(MimeTokenStream.stateToString(expected), MimeTokenStream.stateToString(stream.next()));        
+        assertEquals(MimeTokenStream.stateToString(expected), MimeTokenStream.stateToString(stream.next()));
     }
 }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartStreamTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartStreamTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartStreamTest.java Mon Jul 11 19:48:50 2011
@@ -33,7 +33,7 @@ import org.apache.james.mime4j.util.Char
 public class MultipartStreamTest extends TestCase {
 
     private static final Charset US_ASCII = CharsetUtil.US_ASCII;
-    
+
     private static final String BODY = "A Preamble\r\n" +
                 "--1729\r\n\r\n" +
                 "Simple plain text\r\n" +
@@ -47,7 +47,7 @@ public class MultipartStreamTest extends
             "Subject: Mail\r\n" +
             "Content-Type: multipart/mixed;boundary=1729\r\n\r\n" +
             BODY;
-    
+
     public static final String COMPLEX_MESSAGE = "To: Wile E. Cayote <wile@example.org>\r\n" +
     "From: Road Runner <runner@example.org>\r\n" +
     "Date: Tue, 19 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
@@ -66,9 +66,9 @@ public class MultipartStreamTest extends
     "Custard!" +
     "\r\n" +
     "--42--\r\n";
-    
+
     MimeTokenStream parser;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -79,7 +79,7 @@ public class MultipartStreamTest extends
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testShouldSupplyInputStreamForSimpleBody() throws Exception {
         parser.parse(new ByteArrayInputStream(US_ASCII.encode(MESSAGE).array()));
         checkState(EntityState.T_START_HEADER);
@@ -94,7 +94,7 @@ public class MultipartStreamTest extends
         assertEquals(BODY, IOUtils.toString(out, "us-ascii"));
         checkState(EntityState.T_END_MULTIPART);
     }
-    
+
     public void testInputStreamShouldReadOnlyMessage() throws Exception {
         parser.parse(new ByteArrayInputStream(US_ASCII.encode(COMPLEX_MESSAGE).array()));
         checkState(EntityState.T_START_HEADER);

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartTokensTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartTokensTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartTokensTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/MultipartTokensTest.java Mon Jul 11 19:48:50 2011
@@ -32,7 +32,7 @@ import org.apache.james.mime4j.util.Char
 public class MultipartTokensTest extends TestCase {
 
     private static final Charset US_ASCII = CharsetUtil.US_ASCII;
-    
+
     private static final String BODY = "A Preamble\r\n" +
                 "--1729\r\n\r\n" +
                 "Simple plain text\r\n" +
@@ -47,7 +47,7 @@ public class MultipartTokensTest extends
             "Subject: Mail\r\n" +
             "Content-Type: multipart/mixed;boundary=1729\r\n\r\n" +
             BODY;
-    
+
     public static final String COMPLEX_MESSAGE = "To: Wile E. Cayote <wile@example.org>\r\n" +
     "From: Road Runner <runner@example.org>\r\n" +
     "Date: Tue, 19 Feb 2008 17:34:09 +0000 (GMT)\r\n" +
@@ -67,8 +67,8 @@ public class MultipartTokensTest extends
     "\r\n" +
     "--42--\r\n" +
     "A little epilogue\r\n";
-    
-    public static final String COMPLEX_QP_MESSAGE = 
+
+    public static final String COMPLEX_QP_MESSAGE =
         "Content-Transfer-Encoding: quoted-printable\r\n" +
         "Content-Type: message/rfc822; charset=us-ascii\r\n" +
         "\r\n" +
@@ -92,9 +92,9 @@ public class MultipartTokensTest extends
         "------=3DNextPart--\r\n" +
         "\r\n" +
         "\r\n";
-    
+
     MimeTokenStream parser;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -105,7 +105,7 @@ public class MultipartTokensTest extends
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testShouldParseSimpleMessage() throws Exception {
         parser.parse(new ByteArrayInputStream(US_ASCII.encode(MESSAGE).array()));
         checkState(EntityState.T_START_HEADER);
@@ -133,9 +133,9 @@ public class MultipartTokensTest extends
         checkState(EntityState.T_END_MESSAGE);
         checkState(EntityState.T_END_OF_STREAM);
     }
-    
+
     public void testShouldParseMoreComplexMessage() throws Exception {
-        String message = 
+        String message =
             "Content-Type: multipart/alternative; boundary=\"outer-boundary\"\r\n" +
             "\r\n" +
             "--outer-boundary\r\n" +
@@ -149,7 +149,7 @@ public class MultipartTokensTest extends
             "\r\n" +
             "foo\r\n" +
             "--outer-boundary--\r\n";
-        
+
         parser.parse(new ByteArrayInputStream(US_ASCII.encode(message).array()));
         checkState(EntityState.T_START_HEADER);
         checkState(EntityState.T_FIELD);
@@ -173,7 +173,7 @@ public class MultipartTokensTest extends
         checkState(EntityState.T_END_MESSAGE);
         checkState(EntityState.T_END_OF_STREAM);
     }
-    
+
     public void testShouldParseMessageWithEmbeddedMessage() throws Exception {
         parser.parse(new ByteArrayInputStream(US_ASCII.encode(COMPLEX_MESSAGE).array()));
         checkState(EntityState.T_START_HEADER);
@@ -207,7 +207,7 @@ public class MultipartTokensTest extends
                         checkState(EntityState.T_PREAMBLE);
                         checkState(EntityState.T_START_BODYPART);
                             checkState(EntityState.T_START_HEADER);
-                            checkState(EntityState.T_END_HEADER);   
+                            checkState(EntityState.T_END_HEADER);
                             checkState(EntityState.T_BODY);
                         checkState(EntityState.T_END_BODYPART);
                         checkState(EntityState.T_START_BODYPART);
@@ -251,7 +251,7 @@ public class MultipartTokensTest extends
         checkState(EntityState.T_BODY);
         assertEquals("text/plain", parser.getBodyDescriptor().getMimeType());
         assertEquals("iso-8859-1", parser.getBodyDescriptor().getCharset());
-        assertEquals("Some text\r\n", 
+        assertEquals("Some text\r\n",
                 IOUtils.toString(parser.getInputStream()));
         checkState(EntityState.T_END_BODYPART);
         checkState(EntityState.T_START_BODYPART);
@@ -261,7 +261,7 @@ public class MultipartTokensTest extends
         checkState(EntityState.T_BODY);
         assertEquals("text/html", parser.getBodyDescriptor().getMimeType());
         assertEquals("iso-8859-1", parser.getBodyDescriptor().getCharset());
-        assertEquals("<HTML><BODY>= Some HTML =</BODY></HTML>", 
+        assertEquals("<HTML><BODY>= Some HTML =</BODY></HTML>",
                 IOUtils.toString(parser.getInputStream()));
         checkState(EntityState.T_END_BODYPART);
         checkState(EntityState.T_EPILOGUE);
@@ -270,17 +270,17 @@ public class MultipartTokensTest extends
         checkState(EntityState.T_END_MESSAGE);
         checkState(EntityState.T_END_OF_STREAM);
     }
-    
+
     public void testMultipartMessageWithoutHeader() throws Exception {
-        parser.parseHeadless(new ByteArrayInputStream(US_ASCII.encode(BODY).array()), 
+        parser.parseHeadless(new ByteArrayInputStream(US_ASCII.encode(BODY).array()),
                 "multipart/mixed;boundary=1729");
         // see https://issues.apache.org/jira/browse/MIME4J-153
         // checkState(EntityStates.T_END_HEADER);
-        
+
         // see https://issues.apache.org/jira/browse/MIME4J-153
         // checkState(EntityStates.T_START_MULTIPART);
-        
-        // actually T_START_MULTIPART is the first state, but the 
+
+        // actually T_START_MULTIPART is the first state, but the
         // checkState method calls next() before checking.
         checkState(EntityState.T_PREAMBLE);
         checkState(EntityState.T_START_BODYPART);
@@ -299,7 +299,7 @@ public class MultipartTokensTest extends
         checkState(EntityState.T_END_MESSAGE);
         checkState(EntityState.T_END_OF_STREAM);
     }
-    
+
     private void checkState(final EntityState state) throws IOException, MimeException {
         assertEquals(MimeTokenStream.stateToString(state), MimeTokenStream.stateToString(parser.next()));
     }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java Mon Jul 11 19:48:50 2011
@@ -27,12 +27,12 @@ import org.apache.james.mime4j.MimeIOExc
 import junit.framework.TestCase;
 
 public class StrictMimeTokenStreamTest extends TestCase {
-    
+
     private static final String HEADER_ONLY = "From: foo@abr.com\r\nSubject: A subject\r\n";
     private static final String CORRECT_HEADERS = HEADER_ONLY + "\r\n";
-    
+
     MimeTokenStream parser;
-    
+
     @Override
     protected void setUp() throws Exception {
         super.setUp();
@@ -45,10 +45,10 @@ public class StrictMimeTokenStreamTest e
     protected void tearDown() throws Exception {
         super.tearDown();
     }
-    
+
     public void testUnexpectedEndOfHeaders() throws Exception {
         parser.parse(new ByteArrayInputStream(HEADER_ONLY.getBytes("US-ASCII")));
-        
+
         checkNextIs(EntityState.T_START_HEADER);
         checkNextIs(EntityState.T_FIELD);
         try {
@@ -58,18 +58,18 @@ public class StrictMimeTokenStreamTest e
             assertEquals("Premature end of headers", Event.HEADERS_PREMATURE_END, e.getEvent());
         }
      }
-    
+
     public void testCorrectEndOfHeaders() throws Exception {
         parser.parse(new ByteArrayInputStream(CORRECT_HEADERS.getBytes("US-ASCII")));
-        
+
         checkNextIs(EntityState.T_START_HEADER);
         checkNextIs(EntityState.T_FIELD);
         checkNextIs(EntityState.T_FIELD);
         checkNextIs(EntityState.T_END_HEADER);
      }
-    
+
     public void testMissingBoundary() throws Exception {
-        String message = 
+        String message =
             "Content-Type: multipart/mixed;boundary=aaaa\r\n\r\n" +
             "--aaaa\r\n" +
             "Content-Type:text/plain; charset=US-ASCII\r\n\r\n" +
@@ -97,8 +97,8 @@ public class StrictMimeTokenStreamTest e
             assertEquals("Oh my god! Boundary is missing!\r\n", sb.toString());
         }
      }
-    
+
     private void checkNextIs(EntityState expected) throws Exception {
-        assertEquals(MimeTokenStream.stateToString(expected), MimeTokenStream.stateToString(parser.next()));        
+        assertEquals(MimeTokenStream.stateToString(expected), MimeTokenStream.stateToString(parser.next()));
     }
 }

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java (original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java Mon Jul 11 19:48:50 2011
@@ -30,7 +30,7 @@ public class TestByteArrayBuffer extends
 
     public void testConstructor() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(16);
-        assertEquals(16, buffer.capacity()); 
+        assertEquals(16, buffer.capacity());
         assertEquals(0, buffer.length());
         assertNotNull(buffer.buffer());
         assertEquals(16, buffer.buffer().length);
@@ -41,24 +41,24 @@ public class TestByteArrayBuffer extends
             // expected
         }
     }
-    
+
     public void testSimpleAppend() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(16);
-        assertEquals(16, buffer.capacity()); 
+        assertEquals(16, buffer.capacity());
         assertEquals(0, buffer.length());
         byte[] b1 = buffer.toByteArray();
         assertNotNull(b1);
         assertEquals(0, b1.length);
         assertTrue(buffer.isEmpty());
         assertFalse(buffer.isFull());
-        
+
         byte[] tmp = new byte[] { 1, 2, 3, 4};
         buffer.append(tmp, 0, tmp.length);
-        assertEquals(16, buffer.capacity()); 
+        assertEquals(16, buffer.capacity());
         assertEquals(4, buffer.length());
         assertFalse(buffer.isEmpty());
         assertFalse(buffer.isFull());
-        
+
         byte[] b2 = buffer.toByteArray();
         assertNotNull(b2);
         assertEquals(4, b2.length);
@@ -67,30 +67,30 @@ public class TestByteArrayBuffer extends
             assertEquals(tmp[i], buffer.byteAt(i));
         }
         buffer.clear();
-        assertEquals(16, buffer.capacity()); 
+        assertEquals(16, buffer.capacity());
         assertEquals(0, buffer.length());
         assertTrue(buffer.isEmpty());
         assertFalse(buffer.isFull());
     }
-    
+
     public void testExpandAppend() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(4);
-        assertEquals(4, buffer.capacity()); 
-        
+        assertEquals(4, buffer.capacity());
+
         byte[] tmp = new byte[] { 1, 2, 3, 4};
         buffer.append(tmp, 0, 2);
         buffer.append(tmp, 0, 4);
         buffer.append(tmp, 0, 0);
 
-        assertEquals(8, buffer.capacity()); 
+        assertEquals(8, buffer.capacity());
         assertEquals(6, buffer.length());
-        
+
         buffer.append(tmp, 0, 4);
-        
-        assertEquals(16, buffer.capacity()); 
+
+        assertEquals(16, buffer.capacity());
         assertEquals(10, buffer.length());
     }
-    
+
     public void testInvalidAppend() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(4);
         buffer.append((byte[])null, 0, 0);
@@ -130,26 +130,26 @@ public class TestByteArrayBuffer extends
 
     public void testAppendOneByte() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(4);
-        assertEquals(4, buffer.capacity()); 
-        
+        assertEquals(4, buffer.capacity());
+
         byte[] tmp = new byte[] { 1, 127, -1, -128, 1, -2};
         for (byte b : tmp) {
             buffer.append(b);
         }
-        assertEquals(8, buffer.capacity()); 
+        assertEquals(8, buffer.capacity());
         assertEquals(6, buffer.length());
-        
+
         for (int i = 0; i < tmp.length; i++) {
             assertEquals(tmp[i], buffer.byteAt(i));
         }
     }
-    
+
     public void testSetLength() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(4);
         buffer.setLength(2);
         assertEquals(2, buffer.length());
     }
-    
+
     public void testSetInvalidLength() throws Exception {
         ByteArrayBuffer buffer = new ByteArrayBuffer(4);
         try {
@@ -165,7 +165,7 @@ public class TestByteArrayBuffer extends
             // expected
         }
     }
-    
+
     public void testRemove() throws Exception {
         ByteArrayBuffer b = new ByteArrayBuffer(16);
         byte tmp[] = "--+++-".getBytes("US-ASCII");
@@ -195,7 +195,7 @@ public class TestByteArrayBuffer extends
         assertEquals(3, b.length());
         assertEquals("---", new String(b.buffer(), 0, b.length(), "US-ASCII"));
         b.remove(0, 3);
-        
+
         assertEquals(0, b.length());
     }
 

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Body.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Body.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Body.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Body.java Mon Jul 11 19:48:50 2011
@@ -30,14 +30,14 @@ public interface Body extends Disposable
 
     /**
      * Gets the parent of this body.
-     * 
+     *
      * @return the parent.
      */
     Entity getParent();
 
     /**
      * Sets the parent of this body.
-     * 
+     *
      * @param parent
      *            the parent.
      */

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Disposable.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Disposable.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Disposable.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Disposable.java Mon Jul 11 19:48:50 2011
@@ -22,9 +22,9 @@ package org.apache.james.mime4j.dom;
 /**
  * A <tt>Disposable</tt> is an object that should be disposed of explicitly
  * when it is no longer needed.
- * 
+ *
  * The dispose method is invoked to release resources that the object is
- * holding (such as open files). 
+ * holding (such as open files).
  */
 public interface Disposable {
     /**

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Entity.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Entity.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Entity.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Entity.java Mon Jul 11 19:48:50 2011
@@ -23,18 +23,18 @@ package org.apache.james.mime4j.dom;
  * MIME entity. An entity has a header and a body (see RFC 2045).
  */
 public interface Entity extends Disposable {
-    
+
     /**
      * Gets the parent entity of this entity.
      * Returns <code>null</code> if this is the root entity.
-     * 
+     *
      * @return the parent or <code>null</code>.
      */
     Entity getParent();
-    
+
     /**
      * Sets the parent entity of this entity.
-     * 
+     *
      * @param parent the parent entity or <code>null</code> if
      *        this will be the root entity.
      */
@@ -42,71 +42,71 @@ public interface Entity extends Disposab
 
     /**
      * Gets the entity header.
-     * 
+     *
      * @return the header.
      */
     Header getHeader();
-    
+
     /**
      * Sets the entity header.
-     * 
+     *
      * @param header the header.
      */
     void setHeader(Header header);
-    
+
     /**
      * Gets the body of this entity.
-     * 
+     *
      * @return the body,
      */
     Body getBody();
 
     /**
      * Sets the body of this entity.
-     * 
+     *
      * @param body the body.
      * @throws IllegalStateException if the body has already been set.
      */
     void setBody(Body body);
-    
+
     /**
      * Removes and returns the body of this entity. The removed body may be
      * attached to another entity. If it is no longer needed it should be
      * {@link Disposable#dispose() disposed} of.
-     * 
+     *
      * @return the removed body or <code>null</code> if no body was set.
      */
     Body removeBody();
-    
+
     /**
      * Determines if the MIME type of this <code>Entity</code> is
      * <code>multipart/*</code>. Since multipart-entities must have
      * a boundary parameter in the <code>Content-Type</code> field this
      * method returns <code>false</code> if no boundary exists.
-     * 
+     *
      * @return <code>true</code> on match, <code>false</code> otherwise.
      */
     boolean isMultipart();
-    
+
     /**
      * Determines the MIME type of this <code>Entity</code>. The MIME type
      * is derived by looking at the parent's Content-Type field if no
      * Content-Type field is set for this <code>Entity</code>.
-     * 
+     *
      * @return the MIME type.
      */
     String getMimeType();
 
     /**
      * Determines the MIME character set encoding of this <code>Entity</code>.
-     * 
+     *
      * @return the MIME character set encoding.
      */
     String getCharset();
-    
+
     /**
      * Determines the transfer encoding of this <code>Entity</code>.
-     * 
+     *
      * @return the transfer encoding.
      */
     String getContentTransferEncoding();
@@ -114,7 +114,7 @@ public interface Entity extends Disposab
     /**
      * Return the disposition type of the content disposition of this
      * <code>Entity</code>.
-     * 
+     *
      * @return the disposition type or <code>null</code> if no disposition
      *         type has been set.
      */
@@ -123,10 +123,10 @@ public interface Entity extends Disposab
     /**
      * Returns the filename parameter of the content disposition of this
      * <code>Entity</code>.
-     * 
+     *
      * @return the filename parameter of the content disposition or
      *         <code>null</code> if the filename has not been set.
      */
     String getFilename();
-    
-}
\ No newline at end of file
+
+}

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/FieldParser.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/FieldParser.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/FieldParser.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/FieldParser.java Mon Jul 11 19:48:50 2011
@@ -24,7 +24,7 @@ import org.apache.james.mime4j.dom.field
 import org.apache.james.mime4j.stream.Field;
 
 public interface FieldParser<T extends ParsedField> {
-    
+
     T parse(Field rawField, DecodeMonitor monitor);
-    
+
 }

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=1145308&r1=1145307&r2=1145308&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 Mon Jul 11 19:48:50 2011
@@ -31,15 +31,15 @@ public interface Header extends Iterable
 
     /**
      * Adds a field to the end of the list of fields.
-     * 
+     *
      * @param field the field to add.
      */
     void addField(Field field);
-    
+
     /**
      * Gets the fields of this header. The returned list will not be
      * modifiable.
-     * 
+     *
      * @return the list of <code>Field</code> objects.
      */
     List<Field> getFields();
@@ -47,15 +47,15 @@ public interface Header extends Iterable
     /**
      * Gets a <code>Field</code> given a field name. If there are multiple
      * such fields defined in this header the first one will be returned.
-     * 
+     *
      * @param name the field name (e.g. From, Subject).
      * @return the field or <code>null</code> if none found.
      */
     Field getField(String name);
-    
+
     /**
-     * Gets all <code>Field</code>s having the specified field name. 
-     * 
+     * Gets all <code>Field</code>s having the specified field name.
+     *
      * @param name the field name (e.g. From, Subject).
      * @return the list of fields.
      */
@@ -63,14 +63,14 @@ public interface Header extends Iterable
 
     /**
      * Returns an iterator over the list of fields of this header.
-     * 
+     *
      * @return an iterator.
      */
     Iterator<Field> iterator();
 
     /**
      * Removes all <code>Field</code>s having the specified field name.
-     * 
+     *
      * @param name
      *            the field name (e.g. From, Subject).
      * @return number of fields removed.
@@ -80,15 +80,15 @@ public interface Header extends Iterable
     /**
      * Sets or replaces a field. This method is useful for header fields such as
      * Subject or Message-ID that should not occur more than once in a message.
-     * 
+     *
      * If this <code>Header</code> does not already contain a header field of
      * the same name as the given field then it is added to the end of the list
      * of fields (same behavior as {@link #addField(Field)}). Otherwise the
      * first occurrence of a field with the same name is replaced by the given
      * field and all further occurrences are removed.
-     * 
+     *
      * @param field the field to set.
      */
     void setField(Field field);
-    
+
 }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Message.java Mon Jul 11 19:48:50 2011
@@ -33,7 +33,7 @@ public interface Message extends Entity,
     /**
      * Returns the value of the <i>Message-ID</i> header field of this message
      * or <code>null</code> if it is not present.
-     * 
+     *
      * @return the identifier of this message.
      */
     String getMessageId();
@@ -42,7 +42,7 @@ public interface Message extends Entity,
      * Creates and sets a new <i>Message-ID</i> header field for this message.
      * A <code>Header</code> is created if this message does not already have
      * one.
-     * 
+     *
      * @param hostname
      *            host name to be included in the identifier or
      *            <code>null</code> if no host name should be included.
@@ -52,7 +52,7 @@ public interface Message extends Entity,
     /**
      * Returns the (decoded) value of the <i>Subject</i> header field of this
      * message or <code>null</code> if it is not present.
-     * 
+     *
      * @return the subject of this message.
      */
     String getSubject();
@@ -62,7 +62,7 @@ public interface Message extends Entity,
      * string may contain non-ASCII characters, in which case it gets encoded as
      * an 'encoded-word' automatically. A <code>Header</code> is created if
      * this message does not already have one.
-     * 
+     *
      * @param subject
      *            subject to set or <code>null</code> to remove the subject
      *            header field.
@@ -72,7 +72,7 @@ public interface Message extends Entity,
     /**
      * Returns the value of the <i>Date</i> header field of this message as
      * <code>Date</code> object or <code>null</code> if it is not present.
-     * 
+     *
      * @return the date of this message.
      */
     Date getDate();
@@ -81,7 +81,7 @@ public interface Message extends Entity,
      * Sets the <i>Date</i> header field for this message. This method uses the
      * default <code>TimeZone</code> of this host to encode the specified
      * <code>Date</code> object into a string.
-     * 
+     *
      * @param date
      *            date to set or <code>null</code> to remove the date header
      *            field.
@@ -92,7 +92,7 @@ public interface Message extends Entity,
      * Sets the <i>Date</i> header field for this message. The specified
      * <code>TimeZone</code> is used to encode the specified <code>Date</code>
      * object into a string.
-     * 
+     *
      * @param date
      *            date to set or <code>null</code> to remove the date header
      *            field.
@@ -105,7 +105,7 @@ public interface Message extends Entity,
      * Returns the value of the <i>Sender</i> header field of this message as
      * <code>Mailbox</code> object or <code>null</code> if it is not
      * present.
-     * 
+     *
      * @return the sender of this message.
      */
     Mailbox getSender();
@@ -113,7 +113,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Sender</i> header field of this message to the specified
      * mailbox address.
-     * 
+     *
      * @param sender
      *            address to set or <code>null</code> to remove the header
      *            field.
@@ -124,7 +124,7 @@ public interface Message extends Entity,
      * Returns the value of the <i>From</i> header field of this message as
      * <code>MailboxList</code> object or <code>null</code> if it is not
      * present.
-     * 
+     *
      * @return value of the from field of this message.
      */
     MailboxList getFrom();
@@ -132,7 +132,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>From</i> header field of this message to the specified
      * mailbox address.
-     * 
+     *
      * @param from
      *            address to set or <code>null</code> to remove the header
      *            field.
@@ -142,7 +142,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>From</i> header field of this message to the specified
      * mailbox addresses.
-     * 
+     *
      * @param from
      *            addresses to set or <code>null</code> or no arguments to
      *            remove the header field.
@@ -152,7 +152,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>From</i> header field of this message to the specified
      * mailbox addresses.
-     * 
+     *
      * @param from
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
@@ -163,7 +163,7 @@ public interface Message extends Entity,
      * Returns the value of the <i>To</i> header field of this message as
      * <code>AddressList</code> object or <code>null</code> if it is not
      * present.
-     * 
+     *
      * @return value of the to field of this message.
      */
     AddressList getTo();
@@ -171,7 +171,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>To</i> header field of this message to the specified
      * address.
-     * 
+     *
      * @param to
      *            address to set or <code>null</code> to remove the header
      *            field.
@@ -181,7 +181,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>To</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param to
      *            addresses to set or <code>null</code> or no arguments to
      *            remove the header field.
@@ -191,7 +191,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>To</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param to
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
@@ -202,7 +202,7 @@ public interface Message extends Entity,
      * Returns the value of the <i>Cc</i> header field of this message as
      * <code>AddressList</code> object or <code>null</code> if it is not
      * present.
-     * 
+     *
      * @return value of the cc field of this message.
      */
     AddressList getCc();
@@ -210,7 +210,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Cc</i> header field of this message to the specified
      * address.
-     * 
+     *
      * @param cc
      *            address to set or <code>null</code> to remove the header
      *            field.
@@ -220,7 +220,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Cc</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param cc
      *            addresses to set or <code>null</code> or no arguments to
      *            remove the header field.
@@ -230,7 +230,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Cc</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param cc
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
@@ -241,7 +241,7 @@ public interface Message extends Entity,
      * Returns the value of the <i>Bcc</i> header field of this message as
      * <code>AddressList</code> object or <code>null</code> if it is not
      * present.
-     * 
+     *
      * @return value of the bcc field of this message.
      */
     AddressList getBcc();
@@ -249,7 +249,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Bcc</i> header field of this message to the specified
      * address.
-     * 
+     *
      * @param bcc
      *            address to set or <code>null</code> to remove the header
      *            field.
@@ -259,7 +259,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Bcc</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param bcc
      *            addresses to set or <code>null</code> or no arguments to
      *            remove the header field.
@@ -269,7 +269,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Bcc</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param bcc
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
@@ -280,7 +280,7 @@ public interface Message extends Entity,
      * Returns the value of the <i>Reply-To</i> header field of this message as
      * <code>AddressList</code> object or <code>null</code> if it is not
      * present.
-     * 
+     *
      * @return value of the reply to field of this message.
      */
     AddressList getReplyTo();
@@ -288,7 +288,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Reply-To</i> header field of this message to the specified
      * address.
-     * 
+     *
      * @param replyTo
      *            address to set or <code>null</code> to remove the header
      *            field.
@@ -298,7 +298,7 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Reply-To</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param replyTo
      *            addresses to set or <code>null</code> or no arguments to
      *            remove the header field.
@@ -308,11 +308,11 @@ public interface Message extends Entity,
     /**
      * Sets the <i>Reply-To</i> header field of this message to the specified
      * addresses.
-     * 
+     *
      * @param replyTo
      *            addresses to set or <code>null</code> or an empty collection
      *            to remove the header field.
      */
     void setReplyTo(Collection<Address> replyTo);
 
-}
\ No newline at end of file
+}

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageBuilder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageBuilder.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageBuilder.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageBuilder.java Mon Jul 11 19:48:50 2011
@@ -30,19 +30,19 @@ import org.apache.james.mime4j.MimeExcep
 public interface MessageBuilder {
 
     Header newHeader();
-    
+
     Header newHeader(Header source);
 
     Multipart newMultipart(String subType);
-    
+
     Multipart newMultipart(Multipart source);
 
     Message newMessage();
-          
+
     Message newMessage(Message source);
 
     Header parseHeader(InputStream source) throws MimeException, IOException;
-    
+
     Message parseMessage(InputStream source) throws MimeException, IOException;
-          
-}
\ No newline at end of file
+
+}

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageServiceFactory.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageServiceFactory.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageServiceFactory.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageServiceFactory.java Mon Jul 11 19:48:50 2011
@@ -23,7 +23,7 @@ import org.apache.james.mime4j.MimeExcep
 
 /**
  * A MessageBuilderFactory is used to create EntityBuilder instances.
- * 
+ *
  * MessageBuilderFactory.newInstance() is used to get access to an implementation
  * of MessageBuilderFactory.
  * Then the method newMessageBuilder is used to create a new EntityBuilder object.
@@ -35,9 +35,9 @@ public abstract class MessageServiceFact
     }
 
     public abstract MessageBuilder newMessageBuilder();
-    
+
     public abstract MessageWriter newMessageWriter();
-    
+
     public abstract void setAttribute(String name, Object value) throws IllegalArgumentException;
-        
+
 }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageWriter.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageWriter.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageWriter.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/MessageWriter.java Mon Jul 11 19:48:50 2011
@@ -28,7 +28,7 @@ import org.apache.james.mime4j.stream.Fi
  * Defines the API to write Message and other DOM objects to an output stream.
  */
 public interface MessageWriter {
-    
+
     void writeMessage(Message message, OutputStream out) throws IOException;
 
     void writeBody(Body body, OutputStream out) throws IOException;
@@ -36,7 +36,7 @@ public interface MessageWriter {
     void writeEntity(Entity entity, OutputStream out) throws IOException;
 
     void writeMultipart(Multipart multipart, OutputStream out) throws IOException;
-    
+
     void writeField(Field field, OutputStream out) throws IOException;
 
     void writeHeader(Header header, OutputStream out) throws IOException;

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Multipart.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Multipart.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Multipart.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/Multipart.java Mon Jul 11 19:48:50 2011
@@ -34,28 +34,28 @@ public interface Multipart extends Body 
      * Gets the multipart sub-type. E.g. <code>alternative</code> (the
      * default) or <code>parallel</code>. See RFC 2045 for common sub-types
      * and their meaning.
-     * 
+     *
      * @return the multipart sub-type.
      */
     String getSubType();
-    
+
     /**
      * Returns the number of body parts.
-     * 
+     *
      * @return number of <code>Entity</code> objects.
      */
     int getCount();
 
     /**
      * Gets the list of body parts. The list is immutable.
-     * 
+     *
      * @return the list of <code>Entity</code> objects.
      */
     public List<Entity> getBodyParts();
 
     /**
      * Sets the list of body parts.
-     * 
+     *
      * @param bodyParts
      *            the new list of <code>Entity</code> objects.
      */
@@ -63,7 +63,7 @@ public interface Multipart extends Body 
 
     /**
      * Adds a body part to the end of the list of body parts.
-     * 
+     *
      * @param bodyPart
      *            the body part.
      */
@@ -71,7 +71,7 @@ public interface Multipart extends Body 
 
     /**
      * Inserts a body part at the specified position in the list of body parts.
-     * 
+     *
      * @param bodyPart
      *            the body part.
      * @param index
@@ -85,7 +85,7 @@ public interface Multipart extends Body 
     /**
      * Removes the body part at the specified position in the list of body
      * parts.
-     * 
+     *
      * @param index
      *            index of the body part to be removed.
      * @return the removed body part.
@@ -98,7 +98,7 @@ public interface Multipart extends Body 
     /**
      * Replaces the body part at the specified position in the list of body
      * parts with the specified body part.
-     * 
+     *
      * @param bodyPart
      *            body part to be stored at the specified position.
      * @param index
@@ -112,32 +112,32 @@ public interface Multipart extends Body 
 
     /**
      * Gets the preamble or null if the message has no preamble.
-     * 
+     *
      * @return the preamble.
      */
     String getPreamble();
 
     /**
      * Sets the preamble with a value or null to remove the preamble.
-     * 
+     *
      * @param preamble
      *            the preamble.
      */
     void setPreamble(String preamble);
-    
+
     /**
      * Gets the epilogue or null if the message has no epilogue
-     * 
+     *
      * @return the epilogue.
      */
     String getEpilogue();
 
     /**
      * Sets the epilogue value, or remove it if the value passed is null.
-     * 
+     *
      * @param epilogue
      *            the epilogue.
      */
     void setEpilogue(String epilogue);
-    
+
 }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoader.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoader.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoader.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoader.java Mon Jul 11 19:48:50 2011
@@ -76,15 +76,15 @@ class ServiceLoader {
          } catch (IOException ex) {
              throw new ServiceLoaderException(ex);
          } catch (ClassNotFoundException ex) {
-             throw new ServiceLoaderException("Unknown SPI class '" 
+             throw new ServiceLoaderException("Unknown SPI class '"
                      + spiClass.getName() + "'", ex);
          } catch (IllegalAccessException ex) {
              // Not visible
              return null;
          } catch (InstantiationException ex) {
-             throw new ServiceLoaderException("SPI class '" 
+             throw new ServiceLoaderException("SPI class '"
                      + spiClass.getName() + "' cannot be instantiated", ex);
         }
     }
 
-}
\ No newline at end of file
+}

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoaderException.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoaderException.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoaderException.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/ServiceLoaderException.java Mon Jul 11 19:48:50 2011
@@ -30,7 +30,7 @@ public class ServiceLoaderException exte
     public ServiceLoaderException(Throwable cause) {
         super(cause);
     }
-    
+
     public ServiceLoaderException(String message, Throwable cause) {
         super(message, cause);
     }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/SingleBody.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/SingleBody.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/SingleBody.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/SingleBody.java Mon Jul 11 19:48:50 2011
@@ -54,7 +54,7 @@ public abstract class SingleBody impleme
 
     /**
      * Gets a <code>InputStream</code> which reads the bytes of the body.
-     * 
+     *
      * @return the stream, transfer decoded
      * @throws IOException
      *             on I/O errors.
@@ -65,7 +65,7 @@ public abstract class SingleBody impleme
      * Writes this single body to the given stream. The default implementation copies
      * the input stream obtained by {@link #getInputStream()} to the specified output
      * stream. May be overwritten by a subclass to improve performance.
-     * 
+     *
      * @param out
      *            the stream to write to.
      * @throws IOException
@@ -98,7 +98,7 @@ public abstract class SingleBody impleme
      * <p>
      * This implementation always throws an
      * <code>UnsupportedOperationException</code>.
-     * 
+     *
      * @return a copy of this <code>SingleBody</code>.
      * @throws UnsupportedOperationException
      *             if the <code>copy</code> operation is not supported by this
@@ -112,16 +112,16 @@ public abstract class SingleBody impleme
      * Subclasses should override this method if they have allocated resources
      * that need to be freed explicitly (e.g. cannot be simply reclaimed by the
      * garbage collector).
-     * 
+     *
      * The default implementation of this method does nothing.
-     * 
+     *
      * @see org.apache.james.mime4j.dom.Disposable#dispose()
      */
     public void dispose() {
     }
 
     static final int DEFAULT_ENCODING_BUFFER_SIZE = 1024;
-    
+
     /**
      * Copies the contents of one stream to the other.
      * @param in not null

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/TextBody.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/TextBody.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/TextBody.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/TextBody.java Mon Jul 11 19:48:50 2011
@@ -35,7 +35,7 @@ public abstract class TextBody extends S
 
     /**
      * Returns the MIME charset of this text body.
-     * 
+     *
      * @return the MIME charset.
      */
     public abstract String getMimeCharset();
@@ -43,7 +43,7 @@ public abstract class TextBody extends S
     /**
      * Gets a <code>Reader</code> which may be used to read out the contents
      * of this body.
-     * 
+     *
      * @return the <code>Reader</code>.
      * @throws IOException
      *             on I/O errors.

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Address.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Address.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Address.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Address.java Mon Jul 11 19:48:50 2011
@@ -45,4 +45,4 @@ public abstract class Address implements
      */
     protected abstract void doAddMailboxesTo(List<Mailbox> results);
 
-}
\ No newline at end of file
+}

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/DomainList.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/DomainList.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/DomainList.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/DomainList.java Mon Jul 11 19:48:50 2011
@@ -59,7 +59,7 @@ public class DomainList extends Abstract
 
     /**
      * Gets the domain name or domain literal at the specified index.
-     * 
+     *
      * @throws IndexOutOfBoundsException
      *             If index is &lt; 0 or &gt;= size().
      */

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Group.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Group.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Group.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Group.java Mon Jul 11 19:48:50 2011
@@ -109,5 +109,5 @@ public class Group extends Address {
         sb.append(";");
         return sb.toString();
     }
-    
+
 }

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Mailbox.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Mailbox.java?rev=1145308&r1=1145307&r2=1145308&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Mailbox.java (original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/dom/address/Mailbox.java Mon Jul 11 19:48:50 2011
@@ -42,7 +42,7 @@ public class Mailbox extends Address {
 
     /**
      * Creates a named mailbox with a route. Routes are obsolete.
-     * 
+     *
      * @param name
      *            the name of the e-mail address. May be <code>null</code>.
      * @param route
@@ -75,7 +75,7 @@ public class Mailbox extends Address {
 
     /**
      * Creates an unnamed mailbox without a route. Routes are obsolete.
-     * 
+     *
      * @param localPart
      *            The part of the e-mail address to the left of the "@".
      * @param domain
@@ -87,7 +87,7 @@ public class Mailbox extends Address {
 
     /**
      * Creates an unnamed mailbox with a route. Routes are obsolete.
-     * 
+     *
      * @param route
      *            The zero or more domains that make up the route. May be
      *            <code>null</code>.
@@ -102,7 +102,7 @@ public class Mailbox extends Address {
 
     /**
      * Creates a named mailbox without a route. Routes are obsolete.
-     * 
+     *
      * @param name
      *            the name of the e-mail address. May be <code>null</code>.
      * @param localPart
@@ -146,7 +146,7 @@ public class Mailbox extends Address {
 
     /**
      * Returns the address in the form <i>localPart@domain</i>.
-     * 
+     *
      * @return the address part of this mailbox.
      */
     public String getAddress() {
@@ -166,7 +166,7 @@ public class Mailbox extends Address {
     public int hashCode() {
         int hash = LangUtils.HASH_SEED;
         hash = LangUtils.hashCode(hash, this.localPart);
-        hash = LangUtils.hashCode(hash, this.domain != null ? 
+        hash = LangUtils.hashCode(hash, this.domain != null ?
                 this.domain.toLowerCase(Locale.US) : null);
         return hash;
     }
@@ -179,7 +179,7 @@ public class Mailbox extends Address {
      * The domain is considered to be case-insensitive but the local-part is not
      * (because of RFC 5321: <cite>the local-part of a mailbox MUST BE treated
      * as case sensitive</cite>).
-     * 
+     *
      * @param obj
      *            the object to test for equality.
      * @return <code>true</code> if the specified object is a
@@ -192,7 +192,7 @@ public class Mailbox extends Address {
         if (!(obj instanceof Mailbox))
             return false;
         Mailbox that = (Mailbox) obj;
-        return LangUtils.equals(this.localPart, that.localPart) && 
+        return LangUtils.equals(this.localPart, that.localPart) &&
             LangUtils.equalsIgnoreCase(this.domain, that.domain);
     }
 



Mime
View raw message