| java.lang.Object com.sun.portal.desktop.encode.CookieEncoderDecoder
Field Summary | |
final public static char[] | cookieEscapeChars special characters that need to be escaped when setting cookie value. |
cookieEscapeChars | final public static char[] cookieEscapeChars(Code) | | special characters that need to be escaped when setting cookie value.
|
decode | public String decode(String value)(Code) | | Decodes a cookie cncoded string. A cookie encoded string is one that has had
special characters excaped as %XY where XY is the hex equivalent of the
character's numeric value. The specific characters to be escaped are contained
in the static array cookieEscapeChars.
This method calls java.net.URLDecoder to decode the string. A URL encoded string
is of the same format as a cookie encoded one, with different escape characters.
The implementation of URLDecoder.decode() simply translates all %SY into the
character equivalent, not paying special attention to whether the character represents
something that would have been URL encoded. The implementation here is therefore
dependent upon the implementation of java.net.URLDecoder and may need to be
changed as the JDK implementation changes.
|
encode | public String encode(String value)(Code) | | Encodes a string to be used for a cookie value. Translates any
special characters defined in the static arrays cookieEscapeChars
and encodes the special characters using the following algorithm:
The algorithm translates, for example, ',' the comma character into
'%2c' where 2c is the hex equivalent of the comma character's
numeric value.
|
|
|