| HTTPClient.RoResponse
All known Subclasses: HTTPClient.Response,
RoResponse | public interface RoResponse (Code) | | This interface represents read-only interface of an intermediate http
response. It is the compile-time type passed to various handlers which
might the response info but musn't modify the response.
version: 0.3-2 18/06/1999 author: Ronald Tschalär |
getData | public byte[] getData() throws IOException(Code) | | Reads all the response data into a byte array. Note that this method
won't return until all the data has been received (so for
instance don't invoke this method if the server is doing a server
push). If getInputStream() had been previously called then this method
only returns any unread data remaining on the stream and then closes
it.
See Also: RoResponse.getInputStream() an array containing the data (body) returned. If no datawas returned then it's set to a zero-length array. exception: IOException - If any io exception occured while readingthe data |
getHeader | public String getHeader(String hdr) throws IOException(Code) | | retrieves the field for a given header.
Parameters: hdr - the header name. the value for the header, or null if non-existent. exception: IOException - If any exception occurs on the socket. |
getHeaderAsDate | public Date getHeaderAsDate(String hdr) throws IOException, IllegalArgumentException(Code) | | retrieves the field for a given header. The value is parsed as a
date; if this fails it is parsed as a long representing the number
of seconds since 12:00 AM, Jan 1st, 1970. If this also fails an
IllegalArgumentException is thrown.
Parameters: hdr - the header name. the value for the header, or null if non-existent. exception: IOException - If any exception occurs on the socket. exception: IllegalArgumentException - If the header cannot be parsedas a date or time. |
getHeaderAsInt | public int getHeaderAsInt(String hdr) throws IOException, NumberFormatException(Code) | | retrieves the field for a given header. The value is parsed as an
int.
Parameters: hdr - the header name. the value for the header if the header exists exception: NumberFormatException - if the header's value is not a numberor if the header does not exist. exception: IOException - if any exception occurs on the socket. |
getInputStream | public InputStream getInputStream() throws IOException(Code) | | Gets an input stream from which the returned data can be read. Note
that if getData() had been previously called it will actually return
a ByteArrayInputStream created from that data.
See Also: RoResponse.getData() the InputStream. exception: IOException - If any exception occurs on the socket. |
getReasonLine | public String getReasonLine() throws IOException(Code) | | the reason line associated with the status code. exception: IOException - If any exception occurs on the socket. |
getStatusCode | public int getStatusCode() throws IOException(Code) | | give the status code for this request. These are grouped as follows:
- 1xx - Informational (new in HTTP/1.1)
- 2xx - Success
- 3xx - Redirection
- 4xx - Client Error
- 5xx - Server Error
the status code exception: IOException - If any exception occurs on the socket. |
getTrailer | public String getTrailer(String trailer) throws IOException(Code) | | Retrieves the field for a given trailer. Note that this should not
be invoked until all the response data has been read. If invoked
before, it will force the data to be read via getData() .
Parameters: trailer - the trailer name. the value for the trailer, or null if non-existent. exception: IOException - If any exception occurs on the socket. |
getTrailerAsDate | public Date getTrailerAsDate(String trailer) throws IOException, IllegalArgumentException(Code) | | Retrieves the field for a given trailer. The value is parsed as a
date; if this fails it is parsed as a long representing the number
of seconds since 12:00 AM, Jan 1st, 1970. If this also fails an
IllegalArgumentException is thrown.
Note: When sending dates use Util.httpDate().
Parameters: trailer - the trailer name. the value for the trailer, or null if non-existent. exception: IllegalArgumentException - if the trailer's value is neither alegal date nor a number. exception: IOException - if any exception occurs on the socket. exception: IllegalArgumentException - If the header cannot be parsedas a date or time. |
getTrailerAsInt | public int getTrailerAsInt(String trailer) throws IOException, NumberFormatException(Code) | | Retrieves the field for a given tailer. The value is parsed as an
int.
Parameters: trailer - the tailer name. the value for the trailer if the trailer exists exception: NumberFormatException - if the trailer's value is not a numberor if the trailer does not exist. exception: IOException - if any exception occurs on the socket. |
|
|