public class HttpInputStream
extends java.io.BufferedInputStream
Constructor and Description |
---|
HttpInputStream(java.io.InputStream in)
Constructs a new HttpInputStream
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHeader(java.lang.String name)
Returns a given header by name, assumes lower case
|
java.util.Map |
getHeaders()
Returns a given header by name, assumes lower case
|
java.lang.String |
getMethod()
Returns the method of the request
|
java.lang.String |
getPath()
Returns the path of the request
|
java.lang.String |
getQueryString()
Returns the query string
|
java.lang.String |
getVariable(java.lang.String name)
Returns one variable value.
|
java.util.Map |
getVariables()
Returns a map with the variables passed in the request.
|
java.lang.String[] |
getVariableValues(java.lang.String name)
Returns one variable values.
|
float |
getVersion()
Returns the version of the request
|
protected void |
parseMethod(java.lang.String method)
Parses the connection method.
|
protected void |
parseRequest(java.lang.String request)
Parses the request
|
protected void |
parseVariables()
Parses the request parameters
|
protected void |
parseVersion(java.lang.String verStr)
Parses the request HttpConstants version
|
protected void |
readHeaders()
Reads the headers
|
java.lang.String |
readLine()
Reads an HTTP line
|
void |
readRequest()
Reads the request parsing the headers
|
public HttpInputStream(java.io.InputStream in)
in
- InputStreampublic java.lang.String getMethod()
public java.lang.String getPath()
public java.lang.String getQueryString()
public float getVersion()
public java.lang.String getHeader(java.lang.String name)
name
- Name of the headerpublic java.util.Map getHeaders()
name
- Name of the headerpublic void readRequest() throws java.io.IOException
java.io.IOException
- Description of Exceptionpublic java.lang.String readLine() throws java.io.IOException
java.io.IOException
- Emmited in case of errors reading the streampublic java.util.Map getVariables()
public java.lang.String getVariable(java.lang.String name)
public java.lang.String[] getVariableValues(java.lang.String name)
protected void parseVariables() throws HttpException
HttpException
protected void parseMethod(java.lang.String method) throws HttpException
method
- Description of ParameterHttpException
- Description of Exceptionprotected void parseRequest(java.lang.String request) throws HttpException
request
- Request stringHttpException
- Thrown if an error ocurrprotected void parseVersion(java.lang.String verStr) throws HttpException
verStr
- String containing the HTTP versionHttpException
protected void readHeaders() throws java.io.IOException
java.io.IOException