NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.address
Class RFC2396UrlDecoder

java.lang.Object
  extended by gov.nist.javax.sip.address.RFC2396UrlDecoder

public class RFC2396UrlDecoder
extends Object

Copied from Apache Excalibur project. Source code available at http://www.google.com/codesearch?hl=en&q=+excalibur+decodePath+show:sK_gDY0W5Rw:OTjCHAiSuF0:th3BdHtpX20&sa=N&cd=1&ct=rc&cs_p=http://apache.edgescape.com/excalibur/excalibur-sourceresolve/source/excalibur-sourceresolve-1.1-src.zip&cs_f=excalibur-sourceresolve-1.1/src/java/org/apache/excalibur/source/SourceUtil.java

Author:
Jean Deruelle

Constructor Summary
RFC2396UrlDecoder()
           
 
Method Summary
static String decode(String uri)
          Decode a path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RFC2396UrlDecoder

public RFC2396UrlDecoder()
Method Detail

decode

public static String decode(String uri)
Decode a path.

Interprets %XX (where XX is hexadecimal number) as UTF-8 encoded bytes.

The validity of the input path is not checked (i.e. characters that were not encoded will not be reported as errors).

This method differs from URLDecoder.decode in that it always uses UTF-8 (while URLDecoder uses the platform default encoding, often ISO-8859-1), and doesn't translate + characters to spaces.

Parameters:
uri - the path to decode
Returns:
the decoded path

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.