|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Server.Request.HTTPRequestReader
public class HTTPRequestReader
This class reads HTTP client requests. This class only a simple parse of the requests, chech that the request line had the method, request URI, and the HTTP protocol version. Regarding the HTTP headers, it only check that the header keys were an allowed key.
Usage example:
construct
readHTTPRequest
| Field Summary | |
|---|---|
private HTTPRequest |
httpRequest
Stores the http request sent by a client. |
private static java.util.Set |
httpRequestHeaders
|
private static java.lang.String[] |
httpRequestHeadersList
Allowed HTTP request headers |
private static java.util.Set |
methods
|
private static java.lang.String[] |
methodsList
Allowed HTTP methods |
| Fields inherited from interface CADI.Common.Network.HTTP.StatusCodes |
|---|
ACCEPTED, BAD_REQUEST, NOT_FOUND, NOT_IMPLEMENTED, OK, SERVICE_UNAVAILABLE, UNSUPPORTED_MEDIA_TYPE |
| Constructor Summary | |
|---|---|
HTTPRequestReader()
Constructor. |
|
| Method Summary | |
|---|---|
HTTPRequest |
getHTTPRequest()
Returns the httpRequest attribute. |
void |
list(java.io.PrintStream out)
Prints this HTTP Request Reader fields out to the specified output stream. |
HTTPRequest |
readHTTPRequest(java.io.BufferedReader bufferedReader)
Reads a HTTP request from the socket. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private HTTPRequest httpRequest
private static final java.lang.String[] methodsList
private static final java.util.Set methods
methodsListprivate static final java.lang.String[] httpRequestHeadersList
private static final java.util.Set httpRequestHeaders
httpRequestHeadersList| Constructor Detail |
|---|
public HTTPRequestReader()
| Method Detail |
|---|
public HTTPRequest readHTTPRequest(java.io.BufferedReader bufferedReader)
throws ErrorException,
java.net.SocketTimeoutException,
java.io.IOException
bufferedReader - buffered reader where the http request will be read.
ErrorException
java.net.SocketTimeoutException
java.io.IOExceptionpublic HTTPRequest getHTTPRequest()
httpRequest attribute.
httpRequest attribute.public java.lang.String toString()
toString in class java.lang.Objectpublic void list(java.io.PrintStream out)
out - an output stream.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||