APISonar


org.jboss.resteasy.util.HttpHeaderNames.DATE

> org > jboss > resteasy > util > HttpHeaderNames > DATE
org APIs jboss APIs resteasy APIs util APIs HttpHeaderNames APIs DATE APIs

Example 1
public ClientResponse execute(ClientExecutionContext ctx) throws Exception
   {
      ClientResponse resp = ctx.proceed();
      MultivaluedMap<String, String> headers = resp.getHeaders();
      String date = headers.getFirst(HttpHeaderNames.DATE);
      if (date != null && headers.getFirst(HttpHeaderNames.EXPIRES) == null)
      {
         Calendar cal = Calendar.getInstance();
         cal.setTime(DateUtil.parseDate(date));
         cal.add(Calendar.MINUTE, minutes);
         Date future = cal.getTime();
         headers.add(HttpHeaderNames.EXPIRES, DateUtil.formatDate(future));
      }
      return resp;
   }