@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException ex) { throw new ProcessingException(ex); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException ex) { throw new ProcessingException(ex); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false);
@Override public Date fromString(final String header) { throwIllegalArgumentExceptionIfNull(header, LocalizationMessages.DATE_IS_NULL()); try { return HttpHeaderReader.readDate(header); } catch (final ParseException ex) { throw new IllegalArgumentException( "Error parsing date '" + header + "'", ex); } } }
private Response.ResponseBuilder evaluateIfUnmodifiedSince(final long lastModified) { final String ifUnmodifiedSinceHeader = getHeaderString(HttpHeaders.IF_UNMODIFIED_SINCE); if (ifUnmodifiedSinceHeader != null && !ifUnmodifiedSinceHeader.isEmpty()) { try { final long ifUnmodifiedSince = HttpHeaderReader.readDate(ifUnmodifiedSinceHeader).getTime(); if (roundDown(lastModified) > ifUnmodifiedSince) { // 412 Precondition Failed return Response.status(Response.Status.PRECONDITION_FAILED); } } catch (final ParseException ex) { // Ignore the header if parsing error } } return null; }
private Response.ResponseBuilder evaluateIfModifiedSince(final long lastModified, final String ifModifiedSinceHeader) { try { final long ifModifiedSince = HttpHeaderReader.readDate(ifModifiedSinceHeader).getTime(); if (roundDown(lastModified) <= ifModifiedSince) { // 304 Not modified return Response.notModified(); } } catch (final ParseException ex) { // Ignore the header if parsing error } return null; }
@Override public Date fromString(final String header) { throwIllegalArgumentExceptionIfNull(header, LocalizationMessages.DATE_IS_NULL()); try { return HttpHeaderReader.readDate(header); } catch (final ParseException ex) { throw new IllegalArgumentException( "Error parsing date '" + header + "'", ex); } } }
private Response.ResponseBuilder evaluateIfUnmodifiedSince(final long lastModified) { final String ifUnmodifiedSinceHeader = getHeaderString(HttpHeaders.IF_UNMODIFIED_SINCE); if (ifUnmodifiedSinceHeader != null && !ifUnmodifiedSinceHeader.isEmpty()) { try { final long ifUnmodifiedSince = HttpHeaderReader.readDate(ifUnmodifiedSinceHeader).getTime(); if (roundDown(lastModified) > ifUnmodifiedSince) { // 412 Precondition Failed return Response.status(Response.Status.PRECONDITION_FAILED); } } catch (final ParseException ex) { // Ignore the header if parsing error } } return null; }
private Response.ResponseBuilder evaluateIfModifiedSince(final long lastModified, final String ifModifiedSinceHeader) { try { final long ifModifiedSince = HttpHeaderReader.readDate(ifModifiedSinceHeader).getTime(); if (roundDown(lastModified) <= ifModifiedSince) { // 304 Not modified return Response.notModified(); } } catch (final ParseException ex) { // Ignore the header if parsing error } return null; }
/** * Get message date. * * @return the message date, otherwise {@code null} if not present. */ public Date getDate() { return singleHeader(HttpHeaders.DATE, Date.class, input -> { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } }, false); }
/** * Get message date. * * @return the message date, otherwise {@code null} if not present. */ public Date getDate() { return singleHeader(HttpHeaders.DATE, Date.class, input -> { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } }, false); }
private Response.ResponseBuilder evaluateIfModifiedSince(final long lastModified, final String ifModifiedSinceHeader) { try { final long ifModifiedSince = HttpHeaderReader.readDate(ifModifiedSinceHeader).getTime(); if (roundDown(lastModified) <= ifModifiedSince) { // 304 Not modified return Response.notModified(); } } catch (final ParseException ex) { // Ignore the header if parsing error } return null; }
private Response.ResponseBuilder evaluateIfUnmodifiedSince(final long lastModified) { final String ifUnmodifiedSinceHeader = getHeaderString(HttpHeaders.IF_UNMODIFIED_SINCE); if (ifUnmodifiedSinceHeader != null && !ifUnmodifiedSinceHeader.isEmpty()) { try { final long ifUnmodifiedSince = HttpHeaderReader.readDate(ifUnmodifiedSinceHeader).getTime(); if (roundDown(lastModified) > ifUnmodifiedSince) { // 412 Precondition Failed return Response.status(Response.Status.PRECONDITION_FAILED); } } catch (final ParseException ex) { // Ignore the header if parsing error } } return null; }
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException ex) { throw new ProcessingException(ex); } } }, false);
@Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false);
@Override public Date fromString(final String header) { throwIllegalArgumentExceptionIfNull(header, LocalizationMessages.DATE_IS_NULL()); try { return HttpHeaderReader.readDate(header); } catch (final ParseException ex) { throw new IllegalArgumentException( "Error parsing date '" + header + "'", ex); } } }