java.lang.Objectorg.apache.http.protocol.ResponseDate
All Implemented Interfaces:
HttpResponseInterceptor
Date header to the
outgoing responses. This interceptor is recommended for server side protocol
processors.- version:
$
- Revision: 744532 $
- since:
4.0
-
Constructor:
public ResponseDate() {
super();
}
Method from org.apache.http.protocol.ResponseDate Summary:
process
Methods from java.lang.Object:
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Method from org.apache.http.protocol.ResponseDate Detail:
public void process(HttpResponse response,
HttpContext context) throws HttpException, IOException {
if (response == null) {
throw new IllegalArgumentException
("HTTP response may not be null.");
}
int status = response.getStatusLine().getStatusCode();
if ((status >= HttpStatus.SC_OK) &&
!response.containsHeader(HTTP.DATE_HEADER)) {
String httpdate = DATE_GENERATOR.getCurrentDate();
response.setHeader(HTTP.DATE_HEADER, httpdate);
}
}