Class Codec
java.lang.Object
de.uplanet.lucy.server.auxiliaries.Codec
Encoder/decoder utility class for use in the Velocity context.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbase64DecodeString(String p_str) Decode a Base64 encoded string, using the default character encoding, i.e,UTF-8.base64DecodeString(String p_str, String p_strCharset) Decode a Base64 encoded string, using the specified character encoding.base64EncodeString(String p_str) Encode a string using Base64 encoding, using the default character encoding, i.e,UTF-8.base64EncodeString(String p_str, String p_strCharset) Encode a string using Base64 encoding.encodeURIComponent(CharSequence p_chseq) Encode an URI component as described in the ECMAScript Language Specification, 5th edition, section 15.1.3.4.encodeURIComponent(CharSequence p_chseq, String p_strCharset) Encode an URI component as described in the ECMAScript Language Specification, 5th edition, section 15.1.3.4.hexDecodeString(String p_str) Decode a hex string to string, using the default character encoding, i.e,UTF-8.hexDecodeString(String p_str, String p_strCharset) Decode a hex string to string, using the specified character encoding.hexEncodeString(String p_str) Encode a string to it's hex representation, using the default character encoding, i.e,UTF-8.hexEncodeString(String p_str, String p_strCharset) Encode a string to it's hex representation, using the specified character encoding.Decode a quoted printable encoded string, using the specified character encoding.quotedPrintableDecodeString(String p_str, String p_strCharset) Decode a quoted printable encoded string, using the default character encoding, i.e,UTF-8.Encode a string using quoted printable encoding, using the default character encoding, i.e,UTF-8.quotedPrintableEncodeString(String p_str, String p_strCharset) Encode a string using quoted printable encoding.urlDecodeString(String p_str) URL-decode the given string, using UTF-8.urlDecodeString(String p_str, String p_strCharset) URL-decode the given string, using the specified character encoding.urlEncodeString(String p_str) URL-encode the given string, using UTF-8.urlEncodeString(String p_str, String p_strCharset) URL-encode the given string, using the specified character encoding.
- 
Constructor Details- 
Codecpublic Codec()Construct the object.
 
- 
- 
Method Details- 
hexEncodeStringEncode a string to it's hex representation, using the default character encoding, i.e,UTF-8.- Parameters:
- p_str- The string to encode.
- Returns:
- The hex representation of the string.
 
- 
hexEncodeStringpublic String hexEncodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException Encode a string to it's hex representation, using the specified character encoding.- Parameters:
- p_str- The string to encode.
- p_strCharset- The charset to be used for encoding.
- Returns:
- The hex representation of the string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
hexDecodeStringDecode a hex string to string, using the default character encoding, i.e,UTF-8.- Parameters:
- p_str- The hex string to decode.
- Returns:
- The decoded string.
 
- 
hexDecodeStringDecode a hex string to string, using the specified character encoding.- Parameters:
- p_str- The hex string to decode.
- p_strCharset- The charset to be used for decoding.
- Returns:
- The decoded string, or nullif the given string could not be hex-decoded (see error log for details).
 
- 
base64EncodeStringEncode a string using Base64 encoding, using the default character encoding, i.e,UTF-8.- Parameters:
- p_str- The string to encode.
- Returns:
- The Base64 encoded string.
 
- 
base64EncodeStringpublic String base64EncodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException Encode a string using Base64 encoding.- Parameters:
- p_str- The string to encode.
- p_strCharset- The charset to be used for encoding.
- Returns:
- The Base64 encoded string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
base64DecodeStringDecode a Base64 encoded string, using the default character encoding, i.e,UTF-8.- Parameters:
- p_str- The Base64 encoded string.
- Returns:
- The decoded string.
 
- 
base64DecodeStringpublic String base64DecodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException Decode a Base64 encoded string, using the specified character encoding.- Parameters:
- p_str- The Base64 encoded string.
- p_strCharset- The charset to be used for decoding.
- Returns:
- The decoded string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
quotedPrintableEncodeStringEncode a string using quoted printable encoding, using the default character encoding, i.e,UTF-8.- Parameters:
- p_str- The string to encode.
- Returns:
- The quoted printable encoded string.
 
- 
quotedPrintableEncodeStringpublic String quotedPrintableEncodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException Encode a string using quoted printable encoding.- Parameters:
- p_str- The string to encode.
- p_strCharset- The charset to be used for encoding.
- Returns:
- The quoted printable encoded string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
quotedPrintableDecodeStringDecode a quoted printable encoded string, using the specified character encoding.- Parameters:
- p_str- The quoted printable encoded string.
- Returns:
- The decoded string.
 
- 
quotedPrintableDecodeStringpublic String quotedPrintableDecodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException Decode a quoted printable encoded string, using the default character encoding, i.e,UTF-8.- Parameters:
- p_str- The quoted printable encoded string.
- Returns:
- The decoded string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
encodeURIComponentEncode an URI component as described in the ECMAScript Language Specification, 5th edition, section 15.1.3.4.The charset used for encoding is UTF-8. - Parameters:
- p_chseq- The characters to be encoded.
- Returns:
- The encoded characters.
 
- 
encodeURIComponentEncode an URI component as described in the ECMAScript Language Specification, 5th edition, section 15.1.3.4.- Parameters:
- p_chseq- The characters to be encoded.
- p_strCharset- The character set to be used for encoding.
- Returns:
- The encoded characters.
 
- 
urlEncodeStringURL-encode the given string, using UTF-8.See the application/x-www-form-urlencoded algorithm, and special characters in URI attribute values. - Parameters:
- p_str- The string to be encoded.
- Returns:
- The encoded string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
urlEncodeStringpublic String urlEncodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException URL-encode the given string, using the specified character encoding.See the application/x-www-form-urlencoded algorithm, and special characters in URI attribute values. - Parameters:
- p_str- The string to be encoded.
- p_strCharset- The charset to be used for encoding.
- Returns:
- The encoded string.
- Throws:
- UnsupportedEncodingException- If the specified charset is not supported.
 
- 
urlDecodeStringURL-decode the given string, using UTF-8.See the application/x-www-form-urlencoded algorithm, and special characters in URI attribute values. - Parameters:
- p_str- The string to be decoded.
- Returns:
- The decoded string.
- Throws:
- UnsupportedEncodingException- If the specified encoding is not supported.
 
- 
urlDecodeStringpublic String urlDecodeString(String p_str, String p_strCharset) throws UnsupportedEncodingException URL-decode the given string, using the specified character encoding.See the application/x-www-form-urlencoded algorithm, and special characters in URI attribute values. - Parameters:
- p_str- The string to be decoded.
- p_strCharset- The charset to be used for decoding.
- Returns:
- The decoded string.
- Throws:
- UnsupportedEncodingException- If the specified charset is not supported.
 
 
-