Class IfUnmodifiedSince

All Implemented Interfaces:
Serializable, Cloneable, Header, NameValuePair

@Header("If-Unmodified-Since") public class IfUnmodifiedSince extends BasicDateHeader
Represents a parsed If-Unmodified-Since HTTP request header.

Only send the response if the entity has not been modified since a specific time.

Example

If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

RFC2616 Specification
The If-Unmodified-Since request-header field is used with a method to make it conditional. If the requested resource has not been modified since the time specified in this field, the server SHOULD perform the requested operation as if the If-Unmodified-Since header were not present.

If the requested variant has been modified since the specified time, the server MUST NOT perform the requested operation, and MUST return a 412 (Precondition Failed).

If-Unmodified-Since = "If-Unmodified-Since" ":" HTTP-date

An example of the field is:

If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

If the request normally (i.e., without the If-Unmodified-Since header) would result in anything other than a 2xx or 412 status, the If-Unmodified-Since header SHOULD be ignored.

If the specified date is invalid, the header is ignored.

The result of a request having both an If-Unmodified-Since header field and either an If-None-Match or an If-Modified-Since header fields is undefined by this specification.

See Also:
  • Constructor Details

  • Method Details

    • of

      public static IfUnmodifiedSince of(String value)
      Static creator.
      Parameters:
      value - The header value.
      Must be an RFC-1123 formated string (e.g. "Sat, 29 Oct 1994 19:43:31 GMT").
      Can be null.
      Returns:
      A new header bean, or null if the name is null or empty or the value is null.
    • of

      public static IfUnmodifiedSince of(ZonedDateTime value)
      Static creator.
      Parameters:
      value - The header value.
      Can be null.
      Returns:
      A new header bean, or null if the name is null or empty or the value is null.
    • of

      public static IfUnmodifiedSince of(Supplier<ZonedDateTime> value)
      Static creator with delayed value.

      Header value is re-evaluated on each call to BasicDateHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
      Returns:
      A new header bean, or null if the name is null or empty or the value is null.