Home » apache-tomcat-6.0.26-src » org.apache » catalina » util » [javadoc | source]
org.apache.catalina.util
public final class: RequestUtil [javadoc | source]
java.lang.Object
   org.apache.catalina.util.RequestUtil
General purpose request parsing and encoding utility methods.
Method from org.apache.catalina.util.RequestUtil Summary:
URLDecode,   URLDecode,   URLDecode,   URLDecode,   URLDecode,   URLDecode,   filter,   normalize,   normalize,   parseParameters,   parseParameters
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.util.RequestUtil Detail:
 public static String URLDecode(String str) 
    Decode and return the specified URL-encoded String. When the byte array is converted to a string, the system default character encoding is used... This may be different than some other servers. It is assumed the string is not a query string.
 public static String URLDecode(byte[] bytes) 
    Decode and return the specified URL-encoded byte array. It is assumed the string is not a query string.
 public static String URLDecode(String str,
    String enc) 
    Decode and return the specified URL-encoded String. It is assumed the string is not a query string.
 public static String URLDecode(byte[] bytes,
    String enc) 
    Decode and return the specified URL-encoded byte array. It is assumed the string is not a query string.
 public static String URLDecode(String str,
    String enc,
    boolean isQuery) 
    Decode and return the specified URL-encoded String.
 public static String URLDecode(byte[] bytes,
    String enc,
    boolean isQuery) 
    Decode and return the specified URL-encoded byte array.
 public static String filter(String message) 
    Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.
 public static String normalize(String path) 
    Normalize a relative URI path that may have relative values ("/./", "/../", and so on ) it it. WARNING - This method is useful only for normalizing application-generated paths. It does not try to perform security checks for malicious input.
 public static String normalize(String path,
    boolean replaceBackSlash) 
    Normalize a relative URI path that may have relative values ("/./", "/../", and so on ) it it. WARNING - This method is useful only for normalizing application-generated paths. It does not try to perform security checks for malicious input.
 public static  void parseParameters(Map map,
    String data,
    String encoding) throws UnsupportedEncodingException 
    Append request parameters from the specified String to the specified Map. It is presumed that the specified Map is not accessed from any other thread, so no synchronization is performed.

    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.

 public static  void parseParameters(Map map,
    byte[] data,
    String encoding) throws UnsupportedEncodingException 
    Append request parameters from the specified String to the specified Map. It is presumed that the specified Map is not accessed from any other thread, so no synchronization is performed.

    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.