|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.fw.util.EboEncodeHelper
This utility class provides helper methods for url string encoding/decoding.
Field Summary | |
static String |
DEFAULT_ENCODING
This is the default character encoding used for non-ASCII characters in URLs. |
Constructor Summary | |
EboEncodeHelper()
|
Method Summary | |
static String |
escape(String s)
Escapes a string (using the % escape character) for use as part of an URL. |
static String |
escape(String s,
String encoding)
Escapes a string (using the % escape character) for use as part of an URL, using the specified character encoding. |
static String |
escape(String s,
String encoding,
boolean spacesAsPluses,
boolean encodePluses,
boolean encodeSlashes)
Escapes a string (using the % escape character) for use as part of an URL, using the specified character encoding. |
static String |
unescape(String s)
Undo the effects of the 'escape' method above. |
static String |
unescape(String s,
String encoding)
Undo the effects of the 'escape' method above, using the specified encoding (usually UTF8, but may be overridden). |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final String DEFAULT_ENCODING
Constructor Detail |
public EboEncodeHelper()
Method Detail |
public static String escape(String s)
Note: Do not pass an URL to this function, as all reserved characters will be escaped .
Characters that will not be escaped are: alpha characters, digits, the plus character, and those in the SAFE and EXTRA lists, as defined in RFC1630, available at the time of this writing at: http://www.w3.org/pub/www/addressing/rfc1630.txt.
s
- the string to escapepublic static String escape(String s, String encoding) throws UnsupportedEncodingException
Characters that will not be escaped are: alpha characters, digits, the plus character, and those in the SAFE and EXTRA lists, as defined in RFC1630, available at the time of this writing at: http://www.w3.org/pub/www/addressing/rfc1630.txt.
s
- the string to escapeencoding
- the encoding to usepublic static String escape(String s, String encoding, boolean spacesAsPluses, boolean encodePluses, boolean encodeSlashes) throws UnsupportedEncodingException
Characters that will not be escaped are: alpha characters, digits, and those in the SAFE and EXTRA lists, as defined in RFC1630, available at the time of this writing at: http://www.w3.org/pub/www/addressing/rfc1630.txt.
s
- the string to escapeencoding
- the encoding to usespacesAsPluses
- specifies whether or not to encode spaces
as plus signsencodePluses
- specifies whether or not to encode plus signsencodeSlashes
- specifies whether or not to encode slashespublic static String unescape(String s)
public static String unescape(String s, String encoding) throws UnsupportedEncodingException
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |