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 015/** 016 * Represents a parsed <l>Last-Modified</l> HTTP response header. 017 * 018 * <p> 019 * The last modified date for the requested object (in "HTTP-date" format as defined by RFC 7231). 020 * 021 * <h5 class='figure'>Example</h5> 022 * <p class='bcode'> 023 * Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT 024 * </p> 025 * 026 * <h5 class='topic'>RFC2616 Specification</h5> 027 * 028 * The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was 029 * last modified. 030 * 031 * <p class='bcode'> 032 * Last-Modified = "Last-Modified" ":" HTTP-date 033 * </p> 034 * 035 * <p> 036 * An example of its use is... 037 * <p class='bcode'> 038 * Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT 039 * </p> 040 * 041 * <p> 042 * The exact meaning of this header field depends on the implementation of the origin server and the nature of the 043 * original resource. 044 * For files, it may be just the file system last-modified time. 045 * For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its 046 * component parts. 047 * For database gateways, it may be the last-update time stamp of the record. 048 * For virtual objects, it may be the last time the internal state changed. 049 * 050 * <p> 051 * An origin server MUST NOT send a Last-Modified date which is later than the server's time of message origination. 052 * In such cases, where the resource's last modification would indicate some time in the future, the server MUST replace 053 * that date with the message origination date. 054 * 055 * <p> 056 * An origin server SHOULD obtain the Last-Modified value of the entity as close as possible to the time that it 057 * generates the Date value of its response. 058 * This allows a recipient to make an accurate assessment of the entity's modification time, especially if the entity 059 * changes near the time that the response is generated. 060 * 061 * <p> 062 * HTTP/1.1 servers SHOULD send Last-Modified whenever feasible. 063 * 064 * <h5 class='section'>See Also:</h5> 065 * <ul class='doctree'> 066 * <li class='extlink'><a class='doclink' href='https://www.w3.org/Protocols/rfc2616/rfc2616.html'>Hypertext Transfer Protocol -- HTTP/1.1</a> 067 * </ul> 068 */ 069public final class LastModified extends HeaderDate { 070 071 /** 072 * Returns a parsed <code>Last-Modified</code> header. 073 * 074 * @param value The <code>Last-Modified</code> header string. 075 * @return The parsed <code>Last-Modified</code> header, or <jk>null</jk> if the string was null. 076 */ 077 public static LastModified forString(String value) { 078 if (value == null) 079 return null; 080 return new LastModified(value); 081 } 082 083 private LastModified(String value) { 084 super(value); 085 } 086}