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 * <h5 class='section'>See Also:</h5> 056 * <ul class='doctree'> 057 * <li class='extlink'>{@doc RFC2616} 058 * </ul> 059 */ 060@Header("Server") 061public final class Server extends HeaderString { 062 063 /** 064 * Returns a parsed <code>Server</code> header. 065 * 066 * @param value The <code>Server</code> header string. 067 * @return The parsed <code>Server</code> header, or <jk>null</jk> if the string was null. 068 */ 069 public static Server forString(String value) { 070 if (value == null) 071 return null; 072 return new Server(value); 073 } 074 075 private Server(String value) { 076 super(value); 077 } 078}