Beispiel #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()));
 }
 @Override
 public boolean cancel(Date retryAfter) {
   return doCancel(HttpUtils.getHttpDateFormat().format(retryAfter));
 }
Beispiel #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;
 }