|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.http.HttpUtils
public class HttpUtils
Utility methods useful to for HTTP.
Constructor Summary | |
---|---|
HttpUtils()
|
Method Summary | |
---|---|
static java.lang.StringBuffer |
getRequestURL(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest req)
Obtains the URL used by the client to make the current request, without the query parameters. |
static java.util.Hashtable |
parsePostData(int len,
java.io.InputStream in)
Parses FORM data posted by a client using the HTTP POST method and the application/x-www-form-urlencoded MIME type. |
static java.util.Hashtable |
parseQueryString(java.lang.String s)
Decodes a query string in the format specified by the MIME type "application/x-www-form-urlencoded" . |
static java.lang.String |
trimQueryString(java.lang.String s)
Trims the left-hand side of a URL until the character '?' is reached. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpUtils()
Method Detail |
---|
public static java.lang.String trimQueryString(java.lang.String s)
s
- The string to trim.
public static java.util.Hashtable parseQueryString(java.lang.String s)
"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
.
s
- The string to parse.
public static java.util.Hashtable parsePostData(int len, java.io.InputStream in) throws java.lang.IllegalArgumentException, java.io.IOException
application/x-www-form-urlencoded
MIME type.
len
- The maximum number of bytes to read from the input
stream.in
- The input stream from which to read the form data.
java.lang.IllegalArgumentException
- If the query string is
not formatted correctly.
java.io.IOException
- If an I/O error occurs while reading the
input stream.public static java.lang.StringBuffer getRequestURL(com.lutris.appserver.server.httpPresentation.HttpPresentationRequest req) throws com.lutris.appserver.server.httpPresentation.HttpPresentationException
req
- presentation request object from which
to extract the URL.
com.lutris.appserver.server.httpPresentation.HttpPresentationException
- If an exception is generated
by the req
object.
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |