001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.http;
014
015import org.apache.juneau.http.annotation.*;
016
017/**
018 * Represents a parsed <l>Last-Modified</l> HTTP response header.
019 *
020 * <p>
021 * The last modified date for the requested object (in "HTTP-date" format as defined by RFC 7231).
022 *
023 * <h5 class='figure'>Example</h5>
024 * <p class='bcode w800'>
025 *    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
026 * </p>
027 *
028 * <h5 class='topic'>RFC2616 Specification</h5>
029 *
030 * The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was
031 * last modified.
032 *
033 * <p class='bcode w800'>
034 *    Last-Modified  = "Last-Modified" ":" HTTP-date
035 * </p>
036 *
037 * <p>
038 * An example of its use is...
039 * <p class='bcode w800'>
040 *    Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT
041 * </p>
042 *
043 * <p>
044 * The exact meaning of this header field depends on the implementation of the origin server and the nature of the
045 * original resource.
046 * For files, it may be just the file system last-modified time.
047 * For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its
048 * component parts.
049 * For database gateways, it may be the last-update time stamp of the record.
050 * For virtual objects, it may be the last time the internal state changed.
051 *
052 * <p>
053 * An origin server MUST NOT send a Last-Modified date which is later than the server's time of message origination.
054 * In such cases, where the resource's last modification would indicate some time in the future, the server MUST replace
055 * that date with the message origination date.
056 *
057 * <p>
058 * An origin server SHOULD obtain the Last-Modified value of the entity as close as possible to the time that it
059 * generates the Date value of its response.
060 * This allows a recipient to make an accurate assessment of the entity's modification time, especially if the entity
061 * changes near the time that the response is generated.
062 *
063 * <p>
064 * HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.
065 *
066 * <h5 class='section'>See Also:</h5>
067 * <ul class='doctree'>
068 *    <li class='extlink'>{@doc RFC2616}
069 * </ul>
070 */
071@Header("Last-Modified")
072public final class LastModified extends HeaderDate {
073
074   /**
075    * Returns a parsed <code>Last-Modified</code> header.
076    *
077    * @param value The <code>Last-Modified</code> header string.
078    * @return The parsed <code>Last-Modified</code> header, or <jk>null</jk> if the string was null.
079    */
080   public static LastModified forString(String value) {
081      if (value == null)
082         return null;
083      return new LastModified(value);
084   }
085
086   private LastModified(String value) {
087      super(value);
088   }
089}