FileDocCategorySizeDatePackage
ResponseDate.javaAPI DocAndroid 1.5 API2638Wed May 06 22:41:10 BST 2009org.apache.http.protocol

ResponseDate

public class ResponseDate extends Object implements HttpResponseInterceptor
A response interceptor that adds a Date header. For use on the server side.
author
Oleg Kalnichevski
version
$Revision: 555989 $
since
4.0

Fields Summary
private static final HttpDateGenerator
DATE_GENERATOR
Constructors Summary
public ResponseDate()

 
    
      
        super();
    
Methods Summary
public voidprocess(org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context)

        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); 
        }