org.apache.commons.httpclient.util

Class URIUtil.Coder

protected static class URIUtil.Coder extends URI

Deprecated: use org.apache.commons.codec.net.URLCodec

The basic and internal utility for URI escape and character encoding and decoding.
Method Summary
static Stringdecode(char[] escapedComponent, String charset)
Unescape and decode a given string.
static char[]encode(String unescapedComponent, BitSet allowed, String charset)
Escape and encode a given string with allowed characters not to be escaped.
static Stringreplace(String original, char[] from, char[] to)
Replace from a given character to given character in an array order for a given string.
static Stringreplace(String original, char from, char to)
Replace from a given character to given character for a given string.
static booleanverifyEscaped(char[] original)
Verify whether a given string is escaped or not

Method Detail

decode

public static String decode(char[] escapedComponent, String charset)

Deprecated: use org.apache.commons.codec.net.URLCodec

Unescape and decode a given string.

Parameters: escapedComponent an being-unescaped component charset the charset to decode

Returns: the escaped and encoded string

Throws: URIException if the charset is not supported

encode

public static char[] encode(String unescapedComponent, BitSet allowed, String charset)

Deprecated: use org.apache.commons.codec.net.URLCodec

Escape and encode a given string with allowed characters not to be escaped.

Parameters: unescapedComponent an unescaped component allowed allowed characters not to be escaped charset the charset to encode

Returns: the escaped and encoded string

Throws: URIException if the charset is not supported

replace

public static String replace(String original, char[] from, char[] to)
Replace from a given character to given character in an array order for a given string.

Parameters: original a given string from a replacing character array to a replaced character array

Returns: the replaced string

replace

public static String replace(String original, char from, char to)
Replace from a given character to given character for a given string.

Parameters: original a given string from a replacing character array to a replaced character array

Returns: the replaced string

verifyEscaped

public static boolean verifyEscaped(char[] original)
Verify whether a given string is escaped or not

Parameters: original given characters

Returns: true if the given character array is 7 bit ASCII-compatible.

Copyright (c) 1999-2005 - Apache Software Foundation