| java.lang.Object com.lutris.http.HttpUtils
HttpUtils | public class HttpUtils (Code) | | Utility methods useful to for HTTP.
|
getRequestURL | public static StringBuffer getRequestURL(HttpPresentationRequest req) throws HttpPresentationException(Code) | | Obtains the URL used by the client to make the current request,
without the query parameters. Returns a StringBuffer object that
can be appended to, if the query string must be appended.
Parameters: req - presentation request object from whichto extract the URL. A string buffer object containing the extractedURL. exception: HttpPresentationException - If an exception is generatedby the req object. |
parsePostData | public static Hashtable parsePostData(int len, InputStream in) throws IllegalArgumentException, IOException(Code) | | Parses FORM data posted by a client using the HTTP POST method
and the application/x-www-form-urlencoded MIME type.
Parameters: len - The maximum number of bytes to read from the inputstream. Parameters: in - The input stream from which to read the form data. A Hashtable containing the values indexed bytheir corresponding keys. exception: IllegalArgumentException - If the query string is not formatted correctly. exception: IOException - If an I/O error occurs while reading theinput stream. |
parseQueryString | public static Hashtable parseQueryString(String s)(Code) | | Decodes a query string in the format specified by the MIME
type "application/x-www-form-urlencoded" . Such a
string consists of encoded key/value pairs in the form
key=value . A hash table is returned with each
value indexed by its corresponding key. If a key appears once
in the query string, then the value will be of type
String . If the key appears more than once, then
the value will be an array of type String .
Parameters: s - The string to parse. A Hashtable containing the values indexed bytheir corresponding keys. |
trimQueryString | public static String trimQueryString(String s)(Code) | | Trims the left-hand side of a URL until the character '?'
is reached. This is useful for raw URLs that need to be
parsed as query strings.
Parameters: s - The string to trim. The trimmed string. |
|
|