org.xins.common.text
Class URLEncoding

java.lang.Object
  extended byorg.xins.common.text.URLEncoding

public final class URLEncoding
extends Object

URL encoding utility functions with Unicode support. This class supports both encoding and decoding. All characters higher than 127 will be encoded as %uxxxx where xxxx is the Unicode value of the character in hexadecimal.

Since:
XINS 1.0.0
Version:
$Revision: 1.21 $ $Date: 2006/10/24 11:12:33 $
Author:
Ernst de Haan, Anthony Goubard

Method Summary
static String decode(String s)
          Decodes the specified URL encoded character string.
static String encode(String s)
          URL encodes the specified character string as specified by W3C.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encode

public static String encode(String s)
                     throws IllegalArgumentException
URL encodes the specified character string as specified by W3C. http://www.w3.org/International/O-URL-code.html

Parameters:
s - the string to URL encode, not null.
Returns:
URL encoded version of the specified character string, never null.
Throws:
IllegalArgumentException - if s == null

decode

public static String decode(String s)
                     throws IllegalArgumentException,
                            FormatException
Decodes the specified URL encoded character string. http://www.w3.org/International/O-URL-code.html

Parameters:
s - the URL encoded string to decode, not null.
Returns:
unencoded version of the specified URL encoded character string, never null.
Throws:
IllegalArgumentException - if s == null.
FormatException - if any of the following conditions is true:


See http://www.xins.org/.