public class HTTPResponse
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.String,java.lang.String> |
headers
Contains the HTTP response headers.
|
private int |
responseCode
An
int representing the three digit HTTP Status-Code. |
private java.lang.String |
responseMessage
It is a short description of the status code provided by the server
|
Constructor and Description |
---|
HTTPResponse()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHeaderField(java.lang.String name)
Returns the value of the named header field.
|
java.util.Set<java.lang.String> |
getHeaders()
Returns an unmodifiable Enumeration of the header names.
|
int |
getResponseCode()
Retuns the response code.
|
java.lang.String |
getResponseMessage()
Returns the response message.
|
void |
list(java.io.PrintStream out)
Prints this HTTPResponse out to the specified output stream.
|
void |
reset()
Sets the attributes to inital values.
|
void |
setHeaderField(java.lang.String name,
java.lang.String value)
Puts the value of the named header field.
|
void |
setResponseCode(int responseCode)
Sets the response code.
|
void |
setResponseMessage(java.lang.String responseMessage)
Sets the response message.
|
java.lang.String |
toString() |
private int responseCode
int
representing the three digit HTTP Status-Code.
Allowed values in StatusCodes
private java.lang.String responseMessage
private java.util.HashMap<java.lang.String,java.lang.String> headers
public void setResponseCode(int responseCode)
responseCode
- the response code value.public int getResponseCode()
public void setResponseMessage(java.lang.String responseMessage)
responseMessage
- the response message.public java.lang.String getResponseMessage()
public void setHeaderField(java.lang.String name, java.lang.String value)
name
- the name of the header field.value
- the value of the header field.public java.lang.String getHeaderField(java.lang.String name)
If called on a connection that sets the same header multiple times with possibly different values, only the last value is returned.
name
- the name of a header field.null
if there is no such field in the header.public java.util.Set<java.lang.String> getHeaders()
The Enumeration keys are Strings that represent the response-header field names.
public void reset()
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)