Package anvil.util

Examples of anvil.util.HttpDate


    long last_modified = resource.getLastModified();
    if (last_modified > 0) {
      String if_modified_since = request.getHeader("if-modified-since");
      if (if_modified_since != null) {
        HttpDate ifmod = new HttpDate();
        if (ifmod.parse(if_modified_since)) {
          HttpDate mod = new HttpDate(last_modified);
          if (mod.after(ifmod)) {
            response.setStatus(304);
            response.setContentLength(0);
            return;
          }
        }
View Full Code Here


    buf.append(';');

    int maxage = cookie.getMaxAge();
    if (maxage > -1) {
      buf.append(" expires=");
      HttpDate expires = new HttpDate(System.currentTimeMillis() + maxage*1000);
      buf.append(expires.toCookieString());
      buf.append(';');
    }

    String path = cookie.getPath();
    if (path != null) {
View Full Code Here

  }


  public void setDateHeader(String name, long time)
  {
    setHeader(name, new HttpDate(time).toString());
  }
View Full Code Here

  }


  public void addDateHeader(String name, long time)
  {
    addHeader(name, new HttpDate(time).toString());
  }
View Full Code Here

 
  public long getDateHeader(String name)
  {
    String str = getHeader(name.toLowerCase());
    if (str != null) {
      return new HttpDate(str).getTime();
    }
    return -1;
 
View Full Code Here

TOP

Related Classes of anvil.util.HttpDate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.