james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r712828 - in /james/mime4j/trunk/src: main/java/org/apache/james/mime4j/decoder/ test/java/org/apache/james/mime4j/ test/java/org/apache/james/mime4j/decoder/ test/resources/testmsgs/
Date Mon, 10 Nov 2008 20:44:01 GMT
Author: olegk
Date: Mon Nov 10 12:44:00 2008
New Revision: 712828

URL: http://svn.apache.org/viewvc?rev=712828&view=rev
Log:
MIME4J-84: Base64OutputStream and trailing CRLFs

Contributed by Markus Wiederkehr <markus.wiederkehr at gmail.com> 

Modified:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/decoder/Base64OutputStream.java
    james/mime4j/trunk/src/test/java/org/apache/james/mime4j/ExampleMail.java
    james/mime4j/trunk/src/test/java/org/apache/james/mime4j/decoder/Base64OutputStreamTest.java
    james/mime4j/trunk/src/test/resources/testmsgs/bad-newlines-multiple-parts-base64.out
    james/mime4j/trunk/src/test/resources/testmsgs/base64-encoded-text.out
    james/mime4j/trunk/src/test/resources/testmsgs/base64encoded-rfc822message-nested.out
    james/mime4j/trunk/src/test/resources/testmsgs/base64encoded-rfc822message.out
    james/mime4j/trunk/src/test/resources/testmsgs/example.out
    james/mime4j/trunk/src/test/resources/testmsgs/simple-attachment.out

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/decoder/Base64OutputStream.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/decoder/Base64OutputStream.java?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/decoder/Base64OutputStream.java
(original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/decoder/Base64OutputStream.java
Mon Nov 10 12:44:00 2008
@@ -319,10 +319,8 @@
             if (lineLength > 0) {
                 System.arraycopy(lineSeparator, 0, buf, pos, lineSeparator.length);
                 pos += lineSeparator.length;
-                // TODO I had to add this to make it work as the quoted printable encoder.
-                // not sure this is generally speaking ok.
-                System.arraycopy(lineSeparator, 0, buf, pos, lineSeparator.length);
-                pos += lineSeparator.length;
+//                System.arraycopy(lineSeparator, 0, buf, pos, lineSeparator.length);
+//                pos += lineSeparator.length;
             }
         } else if (offset < 0 || len < 0 || offset + len < 0) {
             throw new IndexOutOfBoundsException();

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/ExampleMail.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/ExampleMail.java?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/ExampleMail.java (original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/ExampleMail.java Mon Nov 10 12:44:00
2008
@@ -251,7 +251,6 @@
         "iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp\r\n"
+
         "rQAAAABJRU5ErkJggg==\r\n" +
         "\r\n" +
-        "\r\n" +
         "--=-tIdGYVstQJghyEDATnJ+\r\n" +
         "Content-Disposition: attachment; filename=blob.png\r\n" +
         "Content-Type: image/png; name=blob.png\r\n" +
@@ -265,7 +264,6 @@
         "iwDgEriEecnLlefFEmGAIvqD4ggJJNMM85qLtXfX9xYGuEQ+4/kIi0g88zlXd66++QaQDG5GPZyp\r\n"
+
         "rQAAAABJRU5ErkJggg==\r\n" +
         "\r\n" +
-        "\r\n" +
         "--=-tIdGYVstQJghyEDATnJ+\r\n" +
         "Content-Disposition: attachment; filename=rhubarb.txt\r\n" +
         "Content-Type: text/plain; name=rhubarb.txt; charset=us-ascii\r\n" +

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/decoder/Base64OutputStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/decoder/Base64OutputStreamTest.java?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/decoder/Base64OutputStreamTest.java
(original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/decoder/Base64OutputStreamTest.java
Mon Nov 10 12:44:00 2008
@@ -38,7 +38,7 @@
         encoder = new Base64OutputStream(bos);
         encoder.write(fromString("This is the plain text message!"));
         encoder.close();
-        assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\n\r\n", toString(bos.toByteArray()));
+        assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\n", toString(bos.toByteArray()));
     }
 
     public void testEncodeUnderlyingStreamStaysOpen() throws IOException {
@@ -60,7 +60,7 @@
         bos.write('a');
         bos.write('d');
         bos.write('a');
-        assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\n\r\nyada", toString(bos.toByteArray()));
+        assertEquals("VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCBtZXNzYWdlIQ==\r\nyada", toString(bos.toByteArray()));
     }
         
     private byte[] fromString(String s) {

Modified: james/mime4j/trunk/src/test/resources/testmsgs/bad-newlines-multiple-parts-base64.out
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/resources/testmsgs/bad-newlines-multiple-parts-base64.out?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/mime4j/trunk/src/test/resources/testmsgs/base64-encoded-text.out
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/resources/testmsgs/base64-encoded-text.out?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/mime4j/trunk/src/test/resources/testmsgs/base64encoded-rfc822message-nested.out
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/resources/testmsgs/base64encoded-rfc822message-nested.out?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/mime4j/trunk/src/test/resources/testmsgs/base64encoded-rfc822message.out
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/resources/testmsgs/base64encoded-rfc822message.out?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/mime4j/trunk/src/test/resources/testmsgs/example.out
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/resources/testmsgs/example.out?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
Binary files - no diff available.

Modified: james/mime4j/trunk/src/test/resources/testmsgs/simple-attachment.out
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/resources/testmsgs/simple-attachment.out?rev=712828&r1=712827&r2=712828&view=diff
==============================================================================
Binary files - no diff available.



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message