|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.util.URLEncoder
public class URLEncoder
Adds methods for the purpose of avoiding calls to the parent's encode methods when the incoming string is determined to already be in a URL safe form.
Field Summary | |
---|---|
static java.util.BitSet |
WWW_FORM_URL_COPY
BitSet of ASCII characters that need to be encoded in a URL. |
Constructor Summary | |
---|---|
URLEncoder()
|
Method Summary | |
---|---|
static java.lang.String |
encodeURL(java.lang.String pString,
java.lang.String charset)
Encodes a String into its URL safe form using the specified string charset. |
static java.lang.String |
encodeURLBasedOnSet(java.util.BitSet safeSet,
java.lang.String pString,
java.lang.String charset,
java.lang.String outputCharset)
Encodes a String into its URL safe form using the specified safe-character BitSet. |
static boolean |
isURLSafe(java.lang.String s)
Returns a boolean indicating whether the incoming String is URL safe. |
Field Detail |
---|
public static final java.util.BitSet WWW_FORM_URL_COPY
Constructor Detail |
---|
public URLEncoder()
Method Detail |
---|
public static java.lang.String encodeURL(java.lang.String pString, java.lang.String charset) throws java.io.UnsupportedEncodingException
pString
- string to convert to a URL safe formcharset
- the charset for pString
java.io.UnsupportedEncodingException
- Thrown if charset is not
supportedisURLSafe(byte[])
,
URLCodec.encodeUrl(java.util.BitSet, byte[])
public static boolean isURLSafe(java.lang.String s)
Returns a boolean indicating whether the incoming String is URL safe.
If any character of the incoming String is not defined in the WWW_FORM_URL set or if any character is a space character, then this method return false. Otherwise, it returns true.
URLCodec.WWW_FORM_URL
,
encodeURL(String, String)
public static java.lang.String encodeURLBasedOnSet(java.util.BitSet safeSet, java.lang.String pString, java.lang.String charset, java.lang.String outputCharset) throws java.io.UnsupportedEncodingException
pString
- string to convert to a URL safe formcharset
- the charset for pStringcharset
- the outputCharset
java.io.UnsupportedEncodingException
- Thrown if charset is not
supportedisURLSafe(byte[])
,
URLCodec.encodeUrl(java.util.BitSet, byte[])
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |