|
Apache Tomcat 7.0.28 | ||||||||
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 String |
filter(String message)
Filter the specified message string for characters that are sensitive in HTML. |
static String |
normalize(String path)
Deprecated. Deprecated to resolve a circular package dependency and will be removed in Tomcat 8.0.x. Use RequestUtil.normalize(String) as
a replacement. |
static String |
normalize(String path,
boolean replaceBackSlash)
Deprecated. Deprecated to resolve a circular package dependency and will be removed in Tomcat 8.0.x. Use RequestUtil.normalize(String,
boolean) as a replacement. |
static void |
parseParameters(Map<String,String[]> map,
byte[] data,
String encoding)
Append request parameters from the specified String to the specified Map. |
static void |
parseParameters(Map<String,String[]> map,
String data,
String encoding)
Append request parameters from the specified String to the specified Map. |
static String |
URLDecode(byte[] bytes)
Decode and return the specified URL-encoded byte array. |
static String |
URLDecode(byte[] bytes,
String enc)
Decode and return the specified URL-encoded byte array. |
static String |
URLDecode(byte[] bytes,
String enc,
boolean isQuery)
Decode and return the specified URL-encoded byte array. |
static String |
URLDecode(String str)
Decode and return the specified URL-encoded String. |
static String |
URLDecode(String str,
String enc)
Decode and return the specified URL-encoded String. |
static String |
URLDecode(String str,
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 String filter(String message)
message
- The message string to be filtered@Deprecated public static String normalize(String path)
RequestUtil.normalize(String)
as
a replacement.
path
- Relative path to be normalized@Deprecated public static String normalize(String path, boolean replaceBackSlash)
RequestUtil.normalize(String,
boolean)
as a replacement.
path
- Relative path to be normalizedreplaceBackSlash
- Should '\\' be replaced with '/'public static void parseParameters(Map<String,String[]> map, String data, String encoding)
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 parametersencoding
- The encoding to use; encoding must not be null.
If an unsupported encoding is specified the parameters will not be
parsed and the map will not be modifiedpublic static String URLDecode(String str)
str
- The url-encoded string
IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static String URLDecode(String str, String enc)
str
- The url-encoded stringenc
- The encoding to use; if null, the default encoding is used. If
an unsupported encoding is specified null will be returned
IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static String URLDecode(String str, String enc, boolean isQuery)
str
- The url-encoded stringenc
- The encoding to use; if null, the default encoding is used. If
an unsupported encoding is specified null will be returnedisQuery
- Is this a query string being processed
IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static String URLDecode(byte[] bytes)
bytes
- The url-encoded byte array
IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static String URLDecode(byte[] bytes, String enc)
bytes
- The url-encoded byte arrayenc
- The encoding to use; if null, the default encoding is used
IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static String URLDecode(byte[] bytes, String enc, boolean isQuery)
bytes
- The url-encoded byte arrayenc
- The encoding to use; if null, the default encoding is used. If
an unsupported encoding is specified null will be returnedisQuery
- Is this a query string being processed
IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static void parseParameters(Map<String,String[]> map, byte[] data, String encoding) throws 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
- The encoding to use; if null, the default encoding is
used
UnsupportedEncodingException
- if the requested encoding is not
supported.
|
Apache Tomcat 7.0.28 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |