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>From</l> HTTP request header. 017 * 018 * <p> 019 * The email address of the user making the request. 020 * 021 * <h5 class='figure'>Example</h5> 022 * <p class='bcode'> 023 * From: user@example.com 024 * </p> 025 * 026 * <h5 class='topic'>RFC2616 Specification</h5> 027 * 028 * The From request-header field, if given, SHOULD contain an Internet e-mail address for the human user who controls 029 * the requesting user agent. 030 * The address SHOULD be machine-usable, as defined by "mailbox" in RFC 822 [9] as updated by RFC 1123 [8]: 031 * 032 * <p class='bcode'> 033 * From = "From" ":" mailbox 034 * </p> 035 * 036 * <p> 037 * An example is: 038 * <p class='bcode'> 039 * From: webmaster@w3.org 040 * </p> 041 * 042 * <p> 043 * This header field MAY be used for logging purposes and as a means for identifying the source of invalid or unwanted 044 * requests. 045 * It SHOULD NOT be used as an insecure form of access protection. 046 * The interpretation of this field is that the request is being performed on behalf of the person given, who accepts 047 * responsibility for the method performed. 048 * In particular, robot agents SHOULD include this header so that the person responsible for running the robot can be 049 * contacted if problems occur on the receiving end. 050 * 051 * <p> 052 * The Internet e-mail address in this field MAY be separate from the Internet host which issued the request. 053 * For example, when a request is passed through a proxy the original issuer's address SHOULD be used. 054 * 055 * <p> 056 * The client SHOULD NOT send the From header field without the user's approval, as it might conflict with the user's 057 * privacy interests or their site's security policy. 058 * It is strongly recommended that the user be able to disable, enable, and modify the value of this field at any time 059 * prior to a request. 060 * 061 * <h5 class='section'>See Also:</h5> 062 * <ul class='doctree'> 063 * <li class='extlink'><a class='doclink' href='https://www.w3.org/Protocols/rfc2616/rfc2616.html'>Hypertext Transfer Protocol -- HTTP/1.1</a> 064 * </ul> 065 */ 066public final class From extends HeaderString { 067 068 /** 069 * Returns a parsed <code>From</code> header. 070 * 071 * @param value The <code>From</code> header string. 072 * @return The parsed <code>From</code> header, or <jk>null</jk> if the string was null. 073 */ 074 public static From forString(String value) { 075 if (value == null) 076 return null; 077 return new From(value); 078 } 079 080 private From(String value) { 081 super(value); 082 } 083}