|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.util.RequestUtil
public final class RequestUtil
General purpose request parsing and encoding utility methods.
Constructor Summary | |
---|---|
RequestUtil()
|
Method Summary | |
---|---|
static java.lang.String |
filter(java.lang.String message)
Filter the specified message string for characters that are sensitive in HTML. |
static java.lang.String |
normalize(java.lang.String path)
Normalize a relative URI path that may have relative values ("/./", "/../", and so on ) it it. |
static java.lang.String |
normalize(java.lang.String path,
boolean replaceBackSlash)
Normalize a relative URI path that may have relative values ("/./", "/../", and so on ) it it. |
static void |
parseParameters(java.util.Map map,
byte[] data,
java.lang.String encoding)
Append request parameters from the specified String to the specified Map. |
static void |
parseParameters(java.util.Map map,
java.lang.String data,
java.lang.String encoding)
Append request parameters from the specified String to the specified Map. |
static java.lang.String |
URLDecode(byte[] bytes)
Decode and return the specified URL-encoded byte array. |
static java.lang.String |
URLDecode(byte[] bytes,
java.lang.String enc)
Decode and return the specified URL-encoded byte array. |
static java.lang.String |
URLDecode(byte[] bytes,
java.lang.String enc,
boolean isQuery)
Decode and return the specified URL-encoded byte array. |
static java.lang.String |
URLDecode(java.lang.String str)
Decode and return the specified URL-encoded String. |
static java.lang.String |
URLDecode(java.lang.String str,
java.lang.String enc)
Decode and return the specified URL-encoded String. |
static java.lang.String |
URLDecode(java.lang.String str,
java.lang.String enc,
boolean isQuery)
Decode and return the specified URL-encoded String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestUtil()
Method Detail |
---|
public static java.lang.String filter(java.lang.String message)
message
- The message string to be filteredpublic static java.lang.String normalize(java.lang.String path)
path
- Relative path to be normalizedpublic static java.lang.String normalize(java.lang.String path, boolean replaceBackSlash)
path
- Relative path to be normalizedreplaceBackSlash
- Should '\\' be replaced with '/'public static void parseParameters(java.util.Map map, java.lang.String data, java.lang.String encoding) throws java.io.UnsupportedEncodingException
IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter.
map
- Map that accumulates the resulting parametersdata
- Input string containing request parameters
java.lang.IllegalArgumentException
- if the data is malformed
java.io.UnsupportedEncodingException
public static java.lang.String URLDecode(java.lang.String str)
str
- The url-encoded string
java.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static java.lang.String URLDecode(java.lang.String str, java.lang.String enc)
str
- The url-encoded stringenc
- The encoding to use; if null, the default encoding is used
java.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static java.lang.String URLDecode(java.lang.String str, java.lang.String enc, boolean isQuery)
str
- The url-encoded stringenc
- The encoding to use; if null, the default encoding is usedisQuery
- Is this a query string being processed
java.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static java.lang.String URLDecode(byte[] bytes)
bytes
- The url-encoded byte array
java.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static java.lang.String URLDecode(byte[] bytes, java.lang.String enc)
bytes
- The url-encoded byte arrayenc
- The encoding to use; if null, the default encoding is used
java.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static java.lang.String URLDecode(byte[] bytes, java.lang.String enc, boolean isQuery)
bytes
- The url-encoded byte arrayenc
- The encoding to use; if null, the default encoding is usedisQuery
- Is this a query string being processed
java.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static void parseParameters(java.util.Map map, byte[] data, java.lang.String encoding) throws java.io.UnsupportedEncodingException
IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter. NOTE: byte array data is modified by this method. Caller beware.
map
- Map that accumulates the resulting parametersdata
- Input string containing request parametersencoding
- Encoding to use for converting hex
java.io.UnsupportedEncodingException
- if the data is malformed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |