public final class RequestUtil
extends java.lang.Object
Constructor and Description |
---|
RequestUtil() |
Modifier and Type | Method and Description |
---|---|
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)
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 java.lang.String |
normalize(java.lang.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(java.util.Map<java.lang.String,java.lang.String[]> map,
byte[] data,
java.lang.String encoding)
Append request parameters from the specified String to the specified
Map.
|
static void |
parseParameters(java.util.Map<java.lang.String,java.lang.String[]> 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)
Deprecated.
Unused - will be removed in 8.0.x
|
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.
|
public static java.lang.String filter(java.lang.String message)
message
- The message string to be filtered@Deprecated public static java.lang.String normalize(java.lang.String path)
RequestUtil.normalize(String)
as
a replacement.path
- Relative path to be normalized@Deprecated public static java.lang.String normalize(java.lang.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(java.util.Map<java.lang.String,java.lang.String[]> map, java.lang.String data, java.lang.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 java.lang.String URLDecode(java.lang.String str)
str
- The url-encoded stringjava.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. If
an unsupported encoding is specified null will be returnedjava.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 used. If
an unsupported encoding is specified null will be returnedisQuery
- Is this a query string being processedjava.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 arrayjava.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal number@Deprecated public 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 usedjava.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 used. If
an unsupported encoding is specified null will be returnedisQuery
- Is this a query string being processedjava.lang.IllegalArgumentException
- if a '%' character is not followed
by a valid 2-digit hexadecimal numberpublic static void parseParameters(java.util.Map<java.lang.String,java.lang.String[]> 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
- The encoding to use; if null, the default encoding is
usedjava.io.UnsupportedEncodingException
- if the requested encoding is not
supported.Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.