Ejemplo n.º 1
0
 private void setResponseDate(MultivaluedMap<String, Object> headers, boolean firstTry) {
   if (!firstTry || headers.containsKey(HttpHeaders.DATE)) {
     return;
   }
   SimpleDateFormat format = HttpUtils.getHttpDateFormat();
   headers.putSingle(HttpHeaders.DATE, format.format(new Date()));
 }
Ejemplo n.º 2
0
 @Override
 public boolean cancel(Date retryAfter) {
   return doCancel(HttpUtils.getHttpDateFormat().format(retryAfter));
 }
Ejemplo n.º 3
0
 /** {@inheritDoc} */
 public Client modified(Date date, boolean ifNot) {
   SimpleDateFormat dateFormat = HttpUtils.getHttpDateFormat();
   String hName = ifNot ? HttpHeaders.IF_UNMODIFIED_SINCE : HttpHeaders.IF_MODIFIED_SINCE;
   state.getRequestHeaders().putSingle(hName, dateFormat.format(date));
   return this;
 }