public class HTTPRequestReader extends java.lang.Object implements StatusCodes
Usage example:
construct
readHTTPRequest
Modifier and Type | Field and Description |
---|---|
private HTTPRequest |
httpRequest
Stores the http request sent by a client.
|
private static java.util.Set<java.lang.String> |
httpRequestHeaders |
private static java.lang.String[] |
httpRequestHeadersList
Allowed HTTP request headers
|
private static java.util.Set<java.lang.String> |
methods |
private static java.lang.String[] |
methodsList
Allowed HTTP methods
|
ACCEPTED, BAD_REQUEST, NOT_FOUND, NOT_IMPLEMENTED, OK, SERVICE_UNAVAILABLE, UNSUPPORTED_MEDIA_TYPE
Constructor and Description |
---|
HTTPRequestReader()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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() |
private HTTPRequest httpRequest
private static final java.lang.String[] methodsList
private static final java.util.Set<java.lang.String> methods
methodsList
private static final java.lang.String[] httpRequestHeadersList
private static final java.util.Set<java.lang.String> httpRequestHeaders
httpRequestHeadersList
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.IOException
public HTTPRequest getHTTPRequest()
httpRequest
attribute.httpRequest
attribute.public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)