|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.slamd.http.HTTPResponse
public class HTTPResponse
This class defines a means of encapsulating an HTTP response returned by a server in response to an HTTP request.
| Constructor Summary | |
|---|---|
HTTPResponse(java.net.URL requestURL,
int statusCode,
java.lang.String protocolVersion,
java.lang.String responseMessage)
Creates a new HTTP response with the provided status code. |
|
| Method Summary | |
|---|---|
void |
addHeader(java.lang.String headerName,
java.lang.String headerValue)
Adds a header with the given name and value to this response. |
int |
getContentLength()
Retrieves the content length associated with this response. |
java.lang.String |
getContentType()
Retrieves the content type associated with this response. |
java.lang.String[] |
getCookieValues()
Retrieves an array containing the values of the cookies that should be set based on the information in this response. |
java.lang.String |
getHeader(java.lang.String headerName)
Retrieves the value of the header with the specified name. |
java.lang.String[][] |
getHeaderElements()
Retrieves a two-dimensional array containing the header data for this response, with each element being an array containing a name/value pair. |
java.lang.String[] |
getHeaderValues(java.lang.String headerName)
Retrieves the set of values for the specified header. |
HTMLDocument |
getHTMLDocument()
Retrieves the HTML document associated with this response. |
java.lang.String |
getProtocolVersion()
Retrieves the protocol version for this HTTP response. |
java.net.URL |
getRequestURL()
Retrieves the URL of the request that generated this HTTP response. |
byte[] |
getResponseData()
Retrieves the raw data included in this HTTP response. |
java.lang.String |
getResponseMessage()
Retrieves the response message for this HTTP response. |
int |
getStatusCode()
Retrieves the status code for this HTTP response. |
void |
parseAsHTMLDocument(java.net.URL requestURL)
Parses the data associated with this response as an HTML document. |
void |
setResponseData(byte[] responseData)
Sets the actual data associated with this response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HTTPResponse(java.net.URL requestURL,
int statusCode,
java.lang.String protocolVersion,
java.lang.String responseMessage)
requestURL - The URL of the request that generated this
response.statusCode - The HTTP status code for this response.protocolVersion - The protocol and version for this response.responseMessage - The message associated with this response.| Method Detail |
|---|
public java.net.URL getRequestURL()
public int getStatusCode()
public java.lang.String getProtocolVersion()
public java.lang.String getResponseMessage()
public java.lang.String getHeader(java.lang.String headerName)
headerName - The name of the header to retrieve.
null if no such header is available.public java.lang.String[] getHeaderValues(java.lang.String headerName)
headerName - The name of the header to retrieve.
public void addHeader(java.lang.String headerName,
java.lang.String headerValue)
headerName - The name of the header to add to this response.headerValue - The value of the header to add to this response.public java.lang.String[][] getHeaderElements()
public byte[] getResponseData()
public void setResponseData(byte[] responseData)
throws java.io.IOException
responseData - The actual data associated with this response.
java.io.IOException - If the data is GZIP-compressed and a problem occurs
during decompression.public int getContentLength()
public java.lang.String getContentType()
null if no content type is available.public java.lang.String[] getCookieValues()
public HTMLDocument getHTMLDocument()
null if no HTML document is available.public void parseAsHTMLDocument(java.net.URL requestURL)
requestURL - The URL of the request that triggered this response.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||