commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1396159 - in /commons/proper/codec/trunk/src: changes/changes.xml main/java/org/apache/commons/codec/binary/Base64.java
Date Tue, 09 Oct 2012 18:26:22 GMT
Author: sebb
Date: Tue Oct  9 18:26:22 2012
New Revision: 1396159

URL: http://svn.apache.org/viewvc?rev=1396159&view=rev
Log:
CODEC-160 Base64.encodeBase64URLSafeString doesn't add padding characters at the end.
Javadoc updated to clarify this

Modified:
    commons/proper/codec/trunk/src/changes/changes.xml
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java

Modified: commons/proper/codec/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/changes/changes.xml?rev=1396159&r1=1396158&r2=1396159&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/changes/changes.xml (original)
+++ commons/proper/codec/trunk/src/changes/changes.xml Tue Oct  9 18:26:22 2012
@@ -48,7 +48,7 @@ The <action> type attribute can be add,u
     </release>
     -->
     <release version="1.8" date="TBA" description="Feature and fix release."> 
-      <action dev="..." type="fix" issue="CODEC-NNN">...</action>   
+      <action dev="sebb" type="fix" issue="CODEC-160">Base64.encodeBase64URLSafeString
doesn't add padding characters at the end.</action>   
     </release>
     <release version="1.7" date="11 September 2012" description="
 Feature and fix release.

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java?rev=1396159&r1=1396158&r2=1396159&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java Tue
Oct  9 18:26:22 2012
@@ -261,6 +261,7 @@ public class Base64 extends BaseNCodec {
      * @param urlSafe
      *            Instead of emitting '+' and '/' we emit '-' and '_' respectively. urlSafe
is only applied to encode
      *            operations. Decoding seamlessly handles both modes.
+     *            <b>Note: no padding is added when using the URL-safe alphabet.</b>
      * @throws IllegalArgumentException
      *             The provided lineSeparator included some base64 characters. That's not
going to work!
      * @since 1.4
@@ -305,9 +306,10 @@ public class Base64 extends BaseNCodec {
     /**
      * <p>
      * Encodes all of the provided data, starting at inPos, for inAvail bytes. Must be called
at least twice: once with
-     * the data to encode, and once with inAvail set to "-1" to alert encoder that EOF has
been reached, so flush last
+     * the data to encode, and once with inAvail set to "-1" to alert encoder that EOF has
been reached, to flush last
      * remaining bytes (if not multiple of 3).
      * </p>
+     * <p><b>Note: no padding is added when encoding using the URL-safe alphabet.</b></p>
      * <p>
      * Thanks to "commons" project in ws.apache.org for the bitwise operations, and general
approach.
      * http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/util/
@@ -567,7 +569,7 @@ public class Base64 extends BaseNCodec {
     /**
      * Encodes binary data using a URL-safe variation of the base64 algorithm but does not
chunk the output. The
      * url-safe variation emits - and _ instead of + and / characters.
-     *
+     * <b>Note: no padding is added.</b>
      * @param binaryData
      *            binary data to encode
      * @return byte[] containing Base64 characters in their UTF-8 representation.
@@ -580,7 +582,7 @@ public class Base64 extends BaseNCodec {
     /**
      * Encodes binary data using a URL-safe variation of the base64 algorithm but does not
chunk the output. The
      * url-safe variation emits - and _ instead of + and / characters.
-     *
+     * <b>Note: no padding is added.</b>
      * @param binaryData
      *            binary data to encode
      * @return String containing Base64 characters
@@ -625,6 +627,7 @@ public class Base64 extends BaseNCodec {
      *            if {@code true} this encoder will chunk the base64 output into 76 character
blocks
      * @param urlSafe
      *            if {@code true} this encoder will emit - and _ instead of the usual + and
/ characters.
+     *            <b>Note: no padding is added when encoding using the URL-safe alphabet.</b>
      * @return Base64-encoded data.
      * @throws IllegalArgumentException
      *             Thrown when the input array needs an output array bigger than {@link Integer#MAX_VALUE}
@@ -643,6 +646,7 @@ public class Base64 extends BaseNCodec {
      *            if {@code true} this encoder will chunk the base64 output into 76 character
blocks
      * @param urlSafe
      *            if {@code true} this encoder will emit - and _ instead of the usual + and
/ characters.
+     *            <b>Note: no padding is added when encoding using the URL-safe alphabet.</b>
      * @param maxResultSize
      *            The maximum result size to accept.
      * @return Base64-encoded data.



Mime
View raw message