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>Server</l> HTTP response header.
019 *
020 * <p>
021 * A name for the server.
022 *
023 * <h5 class='figure'>Example</h5>
024 * <p class='bcode w800'>
025 *    Server: Apache/2.4.1 (Unix)
026 * </p>
027 *
028 * <h5 class='topic'>RFC2616 Specification</h5>
029 *
030 * The Server response-header field contains information about the software used by the origin server to handle the
031 * request.
032 * The field can contain multiple product tokens (section 3.8) and comments identifying the server and any significant
033 * sub-products.
034 * The product tokens are listed in order of their significance for identifying the application.
035 *
036 * <p class='bcode w800'>
037 *    Server         = "Server" ":" 1*( product | comment )
038 * </p>
039 *
040 * <p>
041 * Example:
042 * <p class='bcode w800'>
043 *    Server: CERN/3.0 libwww/2.17
044 * </p>
045 *
046 * <p>
047 * If the response is being forwarded through a proxy, the proxy application MUST NOT modify the Server response-header.
048 * Instead, it SHOULD include a Via field (as described in section 14.45).
049 *
050 * <p>
051 * Note: Revealing the specific software version of the server might allow the server machine to become more vulnerable
052 * to attacks against software that is known to contain security holes.
053 * Server implementors are encouraged to make this field a configurable option.
054 *
055 * <ul class='seealso'>
056 *    <li class='extlink'>{@doc RFC2616}
057 * </ul>
058 */
059@Header("Server")
060public final class Server extends HeaderString {
061
062   /**
063    * Returns a parsed <c>Server</c> header.
064    *
065    * @param value The <c>Server</c> header string.
066    * @return The parsed <c>Server</c> header, or <jk>null</jk> if the string was null.
067    */
068   public static Server forString(String value) {
069      if (value == null)
070         return null;
071      return new Server(value);
072   }
073
074   private Server(String value) {
075      super(value);
076   }
077}