jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1040130 - in /jackrabbit/branches/2.1: ./ RELEASE-NOTES.txt jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/Base64Test.java
Date Mon, 29 Nov 2010 14:45:58 GMT
Author: jukka
Date: Mon Nov 29 14:45:57 2010
New Revision: 1040130

URL: http://svn.apache.org/viewvc?rev=1040130&view=rev
Log:
2.1: Merged revision 1039423 (JCR-2812)

Modified:
    jackrabbit/branches/2.1/   (props changed)
    jackrabbit/branches/2.1/RELEASE-NOTES.txt
    jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java
    jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/Base64Test.java

Propchange: jackrabbit/branches/2.1/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 29 14:45:57 2010
@@ -2,4 +2,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:931121,931479,931483-931484,931504,931609,931613,931838,931919,932318-932319,933144,933197,933203,933213,933216,933554,933646,933694,934405,934412,934849,935557,936668,938099,945528,950440,950680,955222,955229,955307,955852,961487,961626,964362,965539,986682,986686,986715,991144,995411-995412,996810,999298-999299,999965,1000947,1001707,1002065-1002066,1002084,1002101-1002102,1002168,1002170,1002589,1002608,1002657,1002729,1003423,1003470,1003542,1003773,1004182,1004184,1004223-1004224,1004652,1005057,1005112,1036117,1036336-1036337,1038201,1039064,1040090
+/jackrabbit/trunk:931121,931479,931483-931484,931504,931609,931613,931838,931919,932318-932319,933144,933197,933203,933213,933216,933554,933646,933694,934405,934412,934849,935557,936668,938099,945528,950440,950680,955222,955229,955307,955852,961487,961626,964362,965539,986682,986686,986715,991144,995411-995412,996810,999298-999299,999965,1000947,1001707,1002065-1002066,1002084,1002101-1002102,1002168,1002170,1002589,1002608,1002657,1002729,1003423,1003470,1003542,1003773,1004182,1004184,1004223-1004224,1004652,1005057,1005112,1036117,1036336-1036337,1038201,1039064,1039423,1040090

Modified: jackrabbit/branches/2.1/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.1/RELEASE-NOTES.txt?rev=1040130&r1=1040129&r2=1040130&view=diff
==============================================================================
--- jackrabbit/branches/2.1/RELEASE-NOTES.txt (original)
+++ jackrabbit/branches/2.1/RELEASE-NOTES.txt Mon Nov 29 14:45:57 2010
@@ -14,6 +14,10 @@ earlier 2.1.x releases.
 Changes in this release
 -----------------------
 
+Improvements
+
+  [JCR-2812] Allow whitespaces in base64 encoded binary fields of XML ...
+
 Bug fixes
 
   [JCR-2523] StaleItemStateException during distributed transaction

Modified: jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java?rev=1040130&r1=1040129&r2=1040130&view=diff
==============================================================================
--- jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java
(original)
+++ jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/util/Base64.java
Mon Nov 29 14:45:57 2010
@@ -278,7 +278,7 @@ public class Base64 {
                     }
                     posChunk = 0;
                 }
-            } else {
+            } else if (!Character.isWhitespace(c)) {
                 throw new IllegalArgumentException("specified data is not base64 encoded");
             }
         }

Modified: jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/Base64Test.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/Base64Test.java?rev=1040130&r1=1040129&r2=1040130&view=diff
==============================================================================
--- jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/Base64Test.java
(original)
+++ jackrabbit/branches/2.1/jackrabbit-jcr-commons/src/test/java/org/apache/jackrabbit/util/Base64Test.java
Mon Nov 29 14:45:57 2010
@@ -39,6 +39,16 @@ public class Base64Test extends TestCase
     }
 
     /**
+     * Tests that whitespace characters are ignored within base64 data.
+     */
+    public void testWhitespace() throws Exception {
+        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+        Base64.decode(" d G\tV \tzdA\n= =\n", buffer);
+        byte[] data = buffer.toByteArray();
+        assertEquals("test", new String(data, "US-ASCII"));
+    }
+
+    /**
      * Tests that base 64 encoding/decoding round trips are lossless.
      */
     public void testBase64() throws Exception {



Mime
View raw message