org.sandev.tools.HTTP
Class TextEncoder
java.lang.Object
org.sandev.tools.HTTP.TextEncoder
- public class TextEncoder
- extends java.lang.Object
A utility class for encoding and decoding text, used to preserve text
formatting. This is basically a thin wrapper for URLEncoder/Decoder
but without any exceptions thrown.
|
Method Summary |
static java.lang.String |
decode(java.lang.String prefix,
java.lang.String text)
A thin wrapper for URLDecoder.decode which does not throw. |
static java.lang.String |
encode(java.lang.String prefix,
java.lang.String text)
A thin wrapper for URLEncoder.encode which does not throw. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextEncoder
public TextEncoder()
encode
public static java.lang.String encode(java.lang.String prefix,
java.lang.String text)
- A thin wrapper for URLEncoder.encode which does not throw. The
prefix is plain text which is prepended to the returned encoded
text. This allows the corresponding decode action to be able to
toggle on the prefix as an indicator. To skip tagging, use the
empty string.
decode
public static java.lang.String decode(java.lang.String prefix,
java.lang.String text)
- A thin wrapper for URLDecoder.decode which does not throw. The
prefix is plain text which the encoded text must start with for
decoding to be done. To decode without checking for a prefix,
pass the empty string.