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)); }
/** {@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; }