org.apache.juneau.http.Referer Maven / Gradle / Ivy
// ***************************************************************************************************************************
// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
// * with the License. You may obtain a copy of the License at *
// * *
// * http://www.apache.org/licenses/LICENSE-2.0 *
// * *
// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
package org.apache.juneau.http;
import org.apache.juneau.http.annotation.*;
/**
* Represents a parsed Referer HTTP request header.
*
*
* This is the address of the previous web page from which a link to the currently requested page was followed.
* (The word “referrer” has been misspelled in the RFC as well as in most implementations to the point that it has
* become standard usage and is considered correct terminology)
*
*
Example
*
* Referer: http://en.wikipedia.org/wiki/Main_Page
*
*
* RFC2616 Specification
*
* The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of
* the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.)
* The Referer request-header allows a server to generate lists of back-links to resources for interest, logging,
* optimized caching, etc.
* It also allows obsolete or mistyped links to be traced for maintenance.
* The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI,
* such as input from the user keyboard.
*
*
* Referer = "Referer" ":" ( absoluteURI | relativeURI )
*
*
*
* Example:
*
* Referer: http://www.w3.org/hypertext/DataSources/Overview.html
*
*
*
* If the field value is a relative URI, it SHOULD be interpreted relative to the Request-URI.
* The URI MUST NOT include a fragment. See section 15.1.3 for security considerations.
*
*
See Also:
*
* - {@doc RFC2616}
*
*/
@Header("Referer")
public final class Referer extends HeaderUri {
/**
* Returns a parsed Referer
header.
*
* @param value The Referer
header string.
* @return The parsed Referer
header, or null if the string was null.
*/
public static Referer forString(String value) {
if (value == null)
return null;
return new Referer(value);
}
private Referer(String value) {
super(value);
}
}