1 |
/* |
/* |
2 |
* $Id$ |
* Response.java |
3 |
* Copyright (C) 2004 The Free Software Foundation |
* Copyright (C) 2004 The Free Software Foundation |
4 |
* |
* |
5 |
* This file is part of GNU inetlib, a library. |
* This file is part of GNU inetlib, a library. |
89 |
/** |
/** |
90 |
* Constructs a new response with the specified parameters. |
* Constructs a new response with the specified parameters. |
91 |
*/ |
*/ |
92 |
protected Response (int majorVersion, int minorVersion, int code, |
protected Response(int majorVersion, int minorVersion, int code, |
93 |
int codeClass, String message, |
int codeClass, String message, |
94 |
Headers headers) |
Headers headers) |
95 |
{ |
{ |
96 |
this.majorVersion = majorVersion; |
this.majorVersion = majorVersion; |
97 |
this.minorVersion = minorVersion; |
this.minorVersion = minorVersion; |
105 |
* Returns the HTTP major version of the server issuing the response. |
* Returns the HTTP major version of the server issuing the response. |
106 |
* @see #majorVersion |
* @see #majorVersion |
107 |
*/ |
*/ |
108 |
public int getMajorVersion () |
public int getMajorVersion() |
109 |
{ |
{ |
110 |
return majorVersion; |
return majorVersion; |
111 |
} |
} |
114 |
* Returns the HTTP minor version of the server issuing the response. |
* Returns the HTTP minor version of the server issuing the response. |
115 |
* @see #minorVersion |
* @see #minorVersion |
116 |
*/ |
*/ |
117 |
public int getMinorVersion () |
public int getMinorVersion() |
118 |
{ |
{ |
119 |
return minorVersion; |
return minorVersion; |
120 |
} |
} |
123 |
* Returns the HTTP status code of the response. |
* Returns the HTTP status code of the response. |
124 |
* @see #code |
* @see #code |
125 |
*/ |
*/ |
126 |
public int getCode () |
public int getCode() |
127 |
{ |
{ |
128 |
return code; |
return code; |
129 |
} |
} |
132 |
* Returns the class of the response. |
* Returns the class of the response. |
133 |
* @see #codeClass |
* @see #codeClass |
134 |
*/ |
*/ |
135 |
public int getCodeClass () |
public int getCodeClass() |
136 |
{ |
{ |
137 |
return codeClass; |
return codeClass; |
138 |
} |
} |
141 |
* Returns the human-readable text of the response. |
* Returns the human-readable text of the response. |
142 |
* @see #message |
* @see #message |
143 |
*/ |
*/ |
144 |
public String getMessage () |
public String getMessage() |
145 |
{ |
{ |
146 |
return message; |
return message; |
147 |
} |
} |
149 |
/** |
/** |
150 |
* Returns the headers in the response. |
* Returns the headers in the response. |
151 |
*/ |
*/ |
152 |
public Headers getHeaders () |
public Headers getHeaders() |
153 |
{ |
{ |
154 |
return headers; |
return headers; |
155 |
} |
} |
158 |
* Returns the header value for the specified name. |
* Returns the header value for the specified name. |
159 |
* @param name the header name |
* @param name the header name |
160 |
*/ |
*/ |
161 |
public String getHeader (String name) |
public String getHeader(String name) |
162 |
{ |
{ |
163 |
return headers.getValue (name); |
return headers.getValue(name); |
164 |
} |
} |
165 |
|
|
166 |
/** |
/** |
167 |
* Returns the header value for the specified name as an integer. |
* Returns the header value for the specified name as an integer. |
168 |
* @param name the header name |
* @param name the header name |
169 |
*/ |
*/ |
170 |
public int getIntHeader (String name) |
public int getIntHeader(String name) |
171 |
{ |
{ |
172 |
return headers.getIntValue (name); |
return headers.getIntValue(name); |
173 |
} |
} |
174 |
|
|
175 |
/** |
/** |
176 |
* Returns the header value for the specified name as a date. |
* Returns the header value for the specified name as a date. |
177 |
* @param name the header name |
* @param name the header name |
178 |
*/ |
*/ |
179 |
public Date getDateHeader (String name) |
public Date getDateHeader(String name) |
180 |
{ |
{ |
181 |
return headers.getDateValue (name); |
return headers.getDateValue(name); |
182 |
} |
} |
183 |
|
|
184 |
} |
} |
185 |
|
|