org.objectledge.encodings
Class URLEncoder
java.lang.Object
org.objectledge.encodings.URLEncoder
public class URLEncoder
- extends Object
Tool for encoding URLs in a less restrictive manner, ie. allowing / (slash) character in encoded
values, what is useful for putting path values in Query String fields.
- Version:
- $Id: URLEncoder.java,v 1.7 2006/02/08 18:21:20 zwierzem Exp $
- Author:
- Damian Gajda
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PASS_THROUGH
private static final boolean[] PASS_THROUGH
HEX_CHARS
private static final String HEX_CHARS
- See Also:
- Constant Field Values
URLEncoder
public URLEncoder()
encodeQueryStringValue
public String encodeQueryStringValue(String text,
String encodingName)
throws UnsupportedEncodingException
- Encodes a given text as a query string value with UTF-8 encoding.
- Parameters:
text - Text to be encodedencodingName - name of a chosen encoding.
- Returns:
- encoded text
- Throws:
UnsupportedEncodingException - if the requested encoding is not supported.
encodeContentPath
public String encodeContentPath(String text,
String encodingName)
throws UnsupportedEncodingException
- Encodes a given text as a query string value with UTF-8 encoding.
- Parameters:
text - Text to be encodedencodingName - name of a chosen encoding.
- Returns:
- encoded text
- Throws:
UnsupportedEncodingException - if the requested encoding is not supported.
encode
private String encode(String text,
String encodingName,
boolean isQSValue)
throws UnsupportedEncodingException
- Encodes a given text as a query string value or content path with UTF-8 encoding.
- Parameters:
text - Text to be encodedencodingName - name of a chosen encoding.isQSValue - true for encoding a query string value
- Returns:
- encoded text
- Throws:
UnsupportedEncodingException - if the requested encoding is not supported.
Copyright © 2003-2006 objectledge.org. All Rights Reserved.