commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r918899 - in /commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util: Base64.java LocalStrings.properties
Date Thu, 04 Mar 2010 08:59:15 GMT
Author: mturk
Date: Thu Mar  4 08:59:15 2010
New Revision: 918899

URL: http://svn.apache.org/viewvc?rev=918899&view=rev
Log:
use StringManager for common constants

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Base64.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/LocalStrings.properties

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Base64.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Base64.java?rev=918899&r1=918898&r2=918899&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Base64.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/Base64.java
Thu Mar  4 08:59:15 2010
@@ -49,7 +49,7 @@
      * @see <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045 section 6.8</a>
      */
     public  static final int    COLS    = 76;
-    private static final String CHARSET = "ISO-8859-1";
+    private static final String CHARSET = Local.sm.get("base64.charset");
     private static final char   padding = '=';
     private static final char   CR      = '\r';
     private static final char   LF      = '\n';
@@ -148,7 +148,7 @@
             out[3] = ((inp[2] & 0x3F));
 
             if (dp + 4 > dl)
-                throw new IndexOutOfBoundsException("Destination is too small");
+                throw new IndexOutOfBoundsException(Local.sm.get("base64.invalidDestinationSize"));
             dst[dp++] = base64b[out[0]];
             dst[dp++] = base64b[out[1]];
             dst[dp++] = base64b[out[2]];
@@ -171,7 +171,7 @@
             out[2] = ((inp[1] & 0x0F) << 2) + (inp[2] >> 6);
 
             if (dp + 4 > dl)
-                throw new IndexOutOfBoundsException("Destination is too small");
+                throw new IndexOutOfBoundsException(Local.sm.get("base64.invalidDestinationSize"));
             dst[dp++] = base64b[out[0]];
             dst[dp++] = base64b[out[1]];
             if (len == 1)
@@ -211,7 +211,7 @@
             out[3] = ((inp[2] & 0x3F));
 
             if (dp + 4 > dl)
-                throw new IndexOutOfBoundsException("Destination is too small");
+                throw new IndexOutOfBoundsException(Local.sm.get("base64.invalidDestinationSize"));
             dst[dp++] = base64c[out[0]];
             dst[dp++] = base64c[out[1]];
             dst[dp++] = base64c[out[2]];
@@ -234,7 +234,7 @@
             out[2] = ((inp[1] & 0x0F) << 2) + (inp[2] >> 6);
 
             if (dp + 4 > dl)
-                throw new IndexOutOfBoundsException("Destination is too small");
+                throw new IndexOutOfBoundsException(Local.sm.get("base64.invalidDestinationSize"));
             dst[dp++] = base64c[out[0]];
             dst[dp++] = base64c[out[1]];
             if (len == 1)

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/LocalStrings.properties
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/LocalStrings.properties?rev=918899&r1=918898&r2=918899&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/LocalStrings.properties
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/util/LocalStrings.properties
Thu Mar  4 08:59:15 2010
@@ -13,6 +13,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+base64.charset=ISO-8859-1
+base64.invalidDestinationSize=Destination is too small
 uuid.invalidBufferSize=Must be at least 16 bytes
 utils.noWrittableTemp=Cannot find writable temporary directory
 



Mime
View raw message