hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1353368 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
Date Mon, 25 Jun 2012 00:58:19 GMT
Author: sebb
Date: Mon Jun 25 00:58:19 2012
New Revision: 1353368

URL: http://svn.apache.org/viewvc?rev=1353368&view=rev
Log:
Javadoc

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java?rev=1353368&r1=1353367&r2=1353368&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/URLEncodedUtils.java
Mon Jun 25 00:58:19 2012
@@ -258,9 +258,13 @@ public class URLEncodedUtils {
         return result.toString();
     }
 
+    /** Unreserved characters, i.e. alphanumeric, plus: _ - ! . ~ ' ( ) * */
     private static final BitSet UNRESERVED   = new BitSet(256);
+    /** Punctuation characters: , ; : $ & + = */
     private static final BitSet PUNCT        = new BitSet(256);
+    /** Characters which are safe to use, i.e. {@link #UNRESERVED} plus {@link #PUNCT}uation
*/
     private static final BitSet SAFE         = new BitSet(256);
+    /** Characters which are safe to use in a path, i.e. {@link #UNRESERVED} plus {@link
#PUNCT}uation plus / @ */
     private static final BitSet PATHSAFE     = new BitSet(256);
 
     static {
@@ -384,10 +388,24 @@ public class URLEncodedUtils {
         return urlencode(content, charset != null ? charset : Consts.UTF_8, UNRESERVED);
     }
 
+    /**
+     * Encode a String using the {@link #SAFE} set of characters.
+     * 
+     * @param content the string to encode
+     * @param charset the charset to use
+     * @return the encoded string
+     */
     static String enc(final String content, final Charset charset) {
         return urlencode(content, charset, SAFE);
     }
 
+    /**
+     * Encode a String using the {@link #PATHSAFE} set of characters.
+     * 
+     * @param content the string to encode
+     * @param charset the charset to use
+     * @return the encoded string
+     */
     static String encPath(final String content, final Charset charset) {
         return urlencode(content, charset, PATHSAFE);
     }



Mime
View raw message