org.apache.clerezza.triaxrs.util
Class TemplateEncoder

java.lang.Object
  extended by org.apache.clerezza.triaxrs.util.TemplateEncoder

public class TemplateEncoder
extends Object


Method Summary
static String encode(String pathTemplate, String enc)
          Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme.
 
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 pathTemplate,
                            String enc)
                     throws org.apache.clerezza.utils.UriException
Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the supplied encoding scheme to obtain the bytes for unsafe characters.

Note: The World Wide Web Consortium Recommendation states that UTF-8 should be used. Not doing so may introduce incompatibilites.

Parameters:
pathTemplate - String to be translated.
enc - The name of a supported character encoding.
Returns:
the translated String.
Throws:
UnsupportedEncodingException - If the named encoding is not supported
org.apache.clerezza.utils.UriException
Since:
1.4
See Also:
URLDecoder.decode(java.lang.String, java.lang.String)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.