commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1418912 - in /commons/proper/email/trunk/src/main/java/org/apache/commons/mail: EmailUtils.java HtmlEmail.java
Date Sun, 09 Dec 2012 12:27:42 GMT
Author: tn
Date: Sun Dec  9 12:27:41 2012
New Revision: 1418912

URL: http://svn.apache.org/viewvc?rev=1418912&view=rev
Log:
Revert to String#getBytes(String) method as getBytes(Charset) it not available in jdk 1.5.

Modified:
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/EmailUtils.java
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java

Modified: commons/proper/email/trunk/src/main/java/org/apache/commons/mail/EmailUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/EmailUtils.java?rev=1418912&r1=1418911&r2=1418912&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/EmailUtils.java (original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/EmailUtils.java Sun Dec
 9 12:27:41 2012
@@ -26,7 +26,7 @@ import java.util.BitSet;
 import java.util.Random;
 import java.io.File;
 import java.io.IOException;
-import java.nio.charset.Charset;
+import java.io.UnsupportedEncodingException;
 
 /**
  * Utility methods used by commons-email.
@@ -56,7 +56,7 @@ final class EmailUtils
     /**
      * The default charset used for URL encoding.
      */
-    private static final Charset US_ASCII = Charset.forName("US-ASCII");
+    private static final String US_ASCII = "US-ASCII";
 
     /**
      * Radix used in encoding.
@@ -277,9 +277,10 @@ final class EmailUtils
      *
      * @param input the input string to be URL encoded
      * @return a URL encoded string
+     * @throws UnsupportedEncodingException if "US-ASCII" charset is not available
      * @see <a href="http://tools.ietf.org/html/rfc2392">RFC 2392</a>
      */
-    static String encodeUrl(final String input)
+    static String encodeUrl(final String input) throws UnsupportedEncodingException
     {
         if (input == null)
         {

Modified: commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java?rev=1418912&r1=1418911&r2=1418912&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java (original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java Sun Dec
 9 12:27:41 2012
@@ -19,6 +19,7 @@ package org.apache.commons.mail;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.HashMap;
@@ -498,6 +499,10 @@ public class HtmlEmail extends MultiPart
         {
             throw new EmailException(me);
         }
+        catch (UnsupportedEncodingException uee)
+        {
+            throw new EmailException(uee);
+        }
     }
 
     /**



Mime
View raw message