http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/LastModified.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/LastModified.html b/content/site/apidocs/src-html/org/apache/juneau/http/LastModified.html new file mode 100644 index 0000000..50bf2e9 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/LastModified.html @@ -0,0 +1,146 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Last-Modified</l> HTTP response header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * The last modified date for the requested object (in "HTTP-date" format as defined by RFC 7231).<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * The Last-Modified entity-header field indicates the date and time at which the origin server believes the variant was<a name="line.27"></a> +<span class="sourceLineNo">028</span> * last modified.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * <p class='bcode'><a name="line.29"></a> +<span class="sourceLineNo">030</span> * Last-Modified = "Last-Modified" ":" HTTP-date<a name="line.30"></a> +<span class="sourceLineNo">031</span> * </p><a name="line.31"></a> +<span class="sourceLineNo">032</span> * <p><a name="line.32"></a> +<span class="sourceLineNo">033</span> * An example of its use is...<a name="line.33"></a> +<span class="sourceLineNo">034</span> * <p class='bcode'><a name="line.34"></a> +<span class="sourceLineNo">035</span> * Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT<a name="line.35"></a> +<span class="sourceLineNo">036</span> * </p><a name="line.36"></a> +<span class="sourceLineNo">037</span> * <p><a name="line.37"></a> +<span class="sourceLineNo">038</span> * The exact meaning of this header field depends on the implementation of the origin server and the nature of the<a name="line.38"></a> +<span class="sourceLineNo">039</span> * original resource.<a name="line.39"></a> +<span class="sourceLineNo">040</span> * For files, it may be just the file system last-modified time.<a name="line.40"></a> +<span class="sourceLineNo">041</span> * For entities with dynamically included parts, it may be the most recent of the set of last-modify times for its<a name="line.41"></a> +<span class="sourceLineNo">042</span> * component parts.<a name="line.42"></a> +<span class="sourceLineNo">043</span> * For database gateways, it may be the last-update time stamp of the record.<a name="line.43"></a> +<span class="sourceLineNo">044</span> * For virtual objects, it may be the last time the internal state changed.<a name="line.44"></a> +<span class="sourceLineNo">045</span> * <p><a name="line.45"></a> +<span class="sourceLineNo">046</span> * An origin server MUST NOT send a Last-Modified date which is later than the server's time of message origination.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * In such cases, where the resource's last modification would indicate some time in the future, the server MUST replace<a name="line.47"></a> +<span class="sourceLineNo">048</span> * that date with the message origination date.<a name="line.48"></a> +<span class="sourceLineNo">049</span> * <p><a name="line.49"></a> +<span class="sourceLineNo">050</span> * An origin server SHOULD obtain the Last-Modified value of the entity as close as possible to the time that it<a name="line.50"></a> +<span class="sourceLineNo">051</span> * generates the Date value of its response.<a name="line.51"></a> +<span class="sourceLineNo">052</span> * This allows a recipient to make an accurate assessment of the entity's modification time, especially if the entity<a name="line.52"></a> +<span class="sourceLineNo">053</span> * changes near the time that the response is generated.<a name="line.53"></a> +<span class="sourceLineNo">054</span> * <p><a name="line.54"></a> +<span class="sourceLineNo">055</span> * HTTP/1.1 servers SHOULD send Last-Modified whenever feasible.<a name="line.55"></a> +<span class="sourceLineNo">056</span> */<a name="line.56"></a> +<span class="sourceLineNo">057</span>public final class LastModified extends HeaderDate {<a name="line.57"></a> +<span class="sourceLineNo">058</span><a name="line.58"></a> +<span class="sourceLineNo">059</span> /**<a name="line.59"></a> +<span class="sourceLineNo">060</span> * Returns a parsed <code>Last-Modified</code> header.<a name="line.60"></a> +<span class="sourceLineNo">061</span> *<a name="line.61"></a> +<span class="sourceLineNo">062</span> * @param value The <code>Last-Modified</code> header string.<a name="line.62"></a> +<span class="sourceLineNo">063</span> * @return The parsed <code>Last-Modified</code> header, or <jk>null</jk> if the string was null.<a name="line.63"></a> +<span class="sourceLineNo">064</span> */<a name="line.64"></a> +<span class="sourceLineNo">065</span> public static LastModified forString(String value) {<a name="line.65"></a> +<span class="sourceLineNo">066</span> if (value == null)<a name="line.66"></a> +<span class="sourceLineNo">067</span> return null;<a name="line.67"></a> +<span class="sourceLineNo">068</span> return new LastModified(value);<a name="line.68"></a> +<span class="sourceLineNo">069</span> }<a name="line.69"></a> +<span class="sourceLineNo">070</span><a name="line.70"></a> +<span class="sourceLineNo">071</span> private LastModified(String value) {<a name="line.71"></a> +<span class="sourceLineNo">072</span> super(value);<a name="line.72"></a> +<span class="sourceLineNo">073</span> }<a name="line.73"></a> +<span class="sourceLineNo">074</span>}<a name="line.74"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html>
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/Location.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/Location.html b/content/site/apidocs/src-html/org/apache/juneau/http/Location.html new file mode 100644 index 0000000..cc167fa --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/Location.html @@ -0,0 +1,135 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Location</l> HTTP response header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * Used in redirection, or when a new resource has been created.<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Location: http://www.w3.org/pub/WWW/People.html<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * The Location response-header field is used to redirect the recipient to a location other than the Request-URI for<a name="line.27"></a> +<span class="sourceLineNo">028</span> * completion of the request or identification of a new resource.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * For 201 (Created) responses, the Location is that of the new resource which was created by the request.<a name="line.29"></a> +<span class="sourceLineNo">030</span> * For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource.<a name="line.30"></a> +<span class="sourceLineNo">031</span> * The field value consists of a single absolute URI.<a name="line.31"></a> +<span class="sourceLineNo">032</span> * <p class='bcode'><a name="line.32"></a> +<span class="sourceLineNo">033</span> * Location = "Location" ":" absoluteURI<a name="line.33"></a> +<span class="sourceLineNo">034</span> * </p><a name="line.34"></a> +<span class="sourceLineNo">035</span> * <p><a name="line.35"></a> +<span class="sourceLineNo">036</span> * An example is:<a name="line.36"></a> +<span class="sourceLineNo">037</span> * <p class='bcode'><a name="line.37"></a> +<span class="sourceLineNo">038</span> * Location: http://www.w3.org/pub/WWW/People.html<a name="line.38"></a> +<span class="sourceLineNo">039</span> * </p><a name="line.39"></a> +<span class="sourceLineNo">040</span> * <p><a name="line.40"></a> +<span class="sourceLineNo">041</span> * Note: The Content-Location header field (section 14.14) differs from Location in that the Content-Location identifies<a name="line.41"></a> +<span class="sourceLineNo">042</span> * the original location of the entity enclosed in the request.<a name="line.42"></a> +<span class="sourceLineNo">043</span> * It is therefore possible for a response to contain header fields for both Location and Content-Location.<a name="line.43"></a> +<span class="sourceLineNo">044</span> * Also see section 13.10 for cache requirements of some methods.<a name="line.44"></a> +<span class="sourceLineNo">045</span> */<a name="line.45"></a> +<span class="sourceLineNo">046</span>public final class Location extends HeaderUri {<a name="line.46"></a> +<span class="sourceLineNo">047</span><a name="line.47"></a> +<span class="sourceLineNo">048</span> /**<a name="line.48"></a> +<span class="sourceLineNo">049</span> * Returns a parsed <code>Location</code> header.<a name="line.49"></a> +<span class="sourceLineNo">050</span> *<a name="line.50"></a> +<span class="sourceLineNo">051</span> * @param value The <code>Location</code> header string.<a name="line.51"></a> +<span class="sourceLineNo">052</span> * @return The parsed <code>Location</code> header, or <jk>null</jk> if the string was null.<a name="line.52"></a> +<span class="sourceLineNo">053</span> */<a name="line.53"></a> +<span class="sourceLineNo">054</span> public static Location forString(String value) {<a name="line.54"></a> +<span class="sourceLineNo">055</span> if (value == null)<a name="line.55"></a> +<span class="sourceLineNo">056</span> return null;<a name="line.56"></a> +<span class="sourceLineNo">057</span> return new Location(value);<a name="line.57"></a> +<span class="sourceLineNo">058</span> }<a name="line.58"></a> +<span class="sourceLineNo">059</span><a name="line.59"></a> +<span class="sourceLineNo">060</span> private Location(String value) {<a name="line.60"></a> +<span class="sourceLineNo">061</span> super(value);<a name="line.61"></a> +<span class="sourceLineNo">062</span> }<a name="line.62"></a> +<span class="sourceLineNo">063</span>}<a name="line.63"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/MaxForwards.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/MaxForwards.html b/content/site/apidocs/src-html/org/apache/juneau/http/MaxForwards.html new file mode 100644 index 0000000..5789fa1 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/MaxForwards.html @@ -0,0 +1,137 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Max-Forwards</l> HTTP request header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * Limit the number of times the message can be forwarded through proxies or gateways.<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Max-Forwards: 10<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * The Max-Forwards request-header field provides a mechanism with the TRACE (section 9.8) and OPTIONS (section 9.2)<a name="line.27"></a> +<span class="sourceLineNo">028</span> * methods to limit the number of proxies or gateways that can forward the request to the next inbound server.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * This can be useful when the client is attempting to trace a request chain which appears to be failing or looping in<a name="line.29"></a> +<span class="sourceLineNo">030</span> * mid-chain.<a name="line.30"></a> +<span class="sourceLineNo">031</span> * <p class='bcode'><a name="line.31"></a> +<span class="sourceLineNo">032</span> * Max-Forwards = "Max-Forwards" ":" 1*DIGIT<a name="line.32"></a> +<span class="sourceLineNo">033</span> * </p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * <p><a name="line.34"></a> +<span class="sourceLineNo">035</span> * The Max-Forwards value is a decimal integer indicating the remaining number of times this request message may be<a name="line.35"></a> +<span class="sourceLineNo">036</span> * forwarded.<a name="line.36"></a> +<span class="sourceLineNo">037</span> * <p><a name="line.37"></a> +<span class="sourceLineNo">038</span> * Each proxy or gateway recipient of a TRACE or OPTIONS request containing a Max-Forwards header field MUST check and<a name="line.38"></a> +<span class="sourceLineNo">039</span> * update its value prior to forwarding the request.<a name="line.39"></a> +<span class="sourceLineNo">040</span> * If the received value is zero (0), the recipient MUST NOT forward the request; instead, it MUST respond as the final<a name="line.40"></a> +<span class="sourceLineNo">041</span> * recipient.<a name="line.41"></a> +<span class="sourceLineNo">042</span> * If the received Max-Forwards value is greater than zero, then the forwarded message MUST contain an updated<a name="line.42"></a> +<span class="sourceLineNo">043</span> * Max-Forwards field with a value decremented by one (1).<a name="line.43"></a> +<span class="sourceLineNo">044</span> * <p><a name="line.44"></a> +<span class="sourceLineNo">045</span> * The Max-Forwards header field MAY be ignored for all other methods defined by this specification and for any<a name="line.45"></a> +<span class="sourceLineNo">046</span> * extension methods for which it is not explicitly referred to as part of that method definition.<a name="line.46"></a> +<span class="sourceLineNo">047</span> */<a name="line.47"></a> +<span class="sourceLineNo">048</span>public final class MaxForwards extends HeaderInteger {<a name="line.48"></a> +<span class="sourceLineNo">049</span><a name="line.49"></a> +<span class="sourceLineNo">050</span> /**<a name="line.50"></a> +<span class="sourceLineNo">051</span> * Returns a parsed <code>Max-Forwards</code> header.<a name="line.51"></a> +<span class="sourceLineNo">052</span> *<a name="line.52"></a> +<span class="sourceLineNo">053</span> * @param value The <code>Max-Forwards</code> header string.<a name="line.53"></a> +<span class="sourceLineNo">054</span> * @return The parsed <code>Max-Forwards</code> header, or <jk>null</jk> if the string was null.<a name="line.54"></a> +<span class="sourceLineNo">055</span> */<a name="line.55"></a> +<span class="sourceLineNo">056</span> public static MaxForwards forString(String value) {<a name="line.56"></a> +<span class="sourceLineNo">057</span> if (value == null)<a name="line.57"></a> +<span class="sourceLineNo">058</span> return null;<a name="line.58"></a> +<span class="sourceLineNo">059</span> return new MaxForwards(value);<a name="line.59"></a> +<span class="sourceLineNo">060</span> }<a name="line.60"></a> +<span class="sourceLineNo">061</span><a name="line.61"></a> +<span class="sourceLineNo">062</span> private MaxForwards(String value) {<a name="line.62"></a> +<span class="sourceLineNo">063</span> super(value);<a name="line.63"></a> +<span class="sourceLineNo">064</span> }<a name="line.64"></a> +<span class="sourceLineNo">065</span>}<a name="line.65"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/Pragma.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/Pragma.html b/content/site/apidocs/src-html/org/apache/juneau/http/Pragma.html new file mode 100644 index 0000000..e29a400 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/Pragma.html @@ -0,0 +1,143 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Pragma</l> HTTP request/response header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * Implementation-specific fields that may have various effects anywhere along the request-response chain.<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Pragma: no-cache<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> * The Pragma general-header field is used to include implementation- specific directives that might apply to any<a name="line.26"></a> +<span class="sourceLineNo">027</span> * recipient along the request/response chain.<a name="line.27"></a> +<span class="sourceLineNo">028</span> * All pragma directives specify optional behavior from the viewpoint of the protocol; however, some systems MAY<a name="line.28"></a> +<span class="sourceLineNo">029</span> * require that behavior be consistent with the directives.<a name="line.29"></a> +<span class="sourceLineNo">030</span> * <p class='bcode'><a name="line.30"></a> +<span class="sourceLineNo">031</span> * Pragma = "Pragma" ":" 1#pragma-directive<a name="line.31"></a> +<span class="sourceLineNo">032</span> * pragma-directive = "no-cache" | extension-pragma<a name="line.32"></a> +<span class="sourceLineNo">033</span> * extension-pragma = token [ "=" ( token | quoted-string ) ]<a name="line.33"></a> +<span class="sourceLineNo">034</span> * </p><a name="line.34"></a> +<span class="sourceLineNo">035</span> * <p><a name="line.35"></a> +<span class="sourceLineNo">036</span> * When the no-cache directive is present in a request message, an application SHOULD forward the request toward the<a name="line.36"></a> +<span class="sourceLineNo">037</span> * origin server even if it has a cached copy of what is being requested.<a name="line.37"></a> +<span class="sourceLineNo">038</span> * This pragma directive has the same semantics as the no-cache cache-directive (see section 14.9) and is defined here<a name="line.38"></a> +<span class="sourceLineNo">039</span> * for backward compatibility with HTTP/1.0.<a name="line.39"></a> +<span class="sourceLineNo">040</span> * Clients SHOULD include both header fields when a no-cache request is sent to a server not known to be HTTP/1.1<a name="line.40"></a> +<span class="sourceLineNo">041</span> * compliant.<a name="line.41"></a> +<span class="sourceLineNo">042</span> * <p><a name="line.42"></a> +<span class="sourceLineNo">043</span> * Pragma directives MUST be passed through by a proxy or gateway application, regardless of their significance to that<a name="line.43"></a> +<span class="sourceLineNo">044</span> * application, since the directives might be applicable to all recipients along the request/response chain.<a name="line.44"></a> +<span class="sourceLineNo">045</span> * It is not possible to specify a pragma for a specific recipient; however, any pragma directive not relevant to a<a name="line.45"></a> +<span class="sourceLineNo">046</span> * recipient SHOULD be ignored by that recipient.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * <p><a name="line.47"></a> +<span class="sourceLineNo">048</span> * HTTP/1.1 caches SHOULD treat "Pragma: no-cache" as if the client had sent "Cache-Control: no-cache".<a name="line.48"></a> +<span class="sourceLineNo">049</span> * No new Pragma directives will be defined in HTTP.<a name="line.49"></a> +<span class="sourceLineNo">050</span> * <p><a name="line.50"></a> +<span class="sourceLineNo">051</span> * Note: because the meaning of "Pragma: no-cache as a response header field is not actually specified, it does not<a name="line.51"></a> +<span class="sourceLineNo">052</span> * provide a reliable replacement for "Cache-Control: no-cache" in a response.<a name="line.52"></a> +<span class="sourceLineNo">053</span> */<a name="line.53"></a> +<span class="sourceLineNo">054</span>public final class Pragma extends HeaderString {<a name="line.54"></a> +<span class="sourceLineNo">055</span><a name="line.55"></a> +<span class="sourceLineNo">056</span> /**<a name="line.56"></a> +<span class="sourceLineNo">057</span> * Returns a parsed <code>Pragma</code> header.<a name="line.57"></a> +<span class="sourceLineNo">058</span> *<a name="line.58"></a> +<span class="sourceLineNo">059</span> * @param value The <code>Pragma</code> header string.<a name="line.59"></a> +<span class="sourceLineNo">060</span> * @return The parsed <code>Pragma</code> header, or <jk>null</jk> if the string was null.<a name="line.60"></a> +<span class="sourceLineNo">061</span> */<a name="line.61"></a> +<span class="sourceLineNo">062</span> public static Pragma forString(String value) {<a name="line.62"></a> +<span class="sourceLineNo">063</span> if (value == null)<a name="line.63"></a> +<span class="sourceLineNo">064</span> return null;<a name="line.64"></a> +<span class="sourceLineNo">065</span> return new Pragma(value);<a name="line.65"></a> +<span class="sourceLineNo">066</span> }<a name="line.66"></a> +<span class="sourceLineNo">067</span><a name="line.67"></a> +<span class="sourceLineNo">068</span> private Pragma(String value) {<a name="line.68"></a> +<span class="sourceLineNo">069</span> super(value);<a name="line.69"></a> +<span class="sourceLineNo">070</span> }<a name="line.70"></a> +<span class="sourceLineNo">071</span>}<a name="line.71"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthenticate.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthenticate.html b/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthenticate.html new file mode 100644 index 0000000..56d45b3 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthenticate.html @@ -0,0 +1,130 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l> Proxy-Authenticate</l> HTTP response header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * Request authentication to access the proxy.<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Proxy-Authenticate: Basic<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * The Proxy-Authenticate response-header field MUST be included as part of a 407 (Proxy Authentication Required)<a name="line.27"></a> +<span class="sourceLineNo">028</span> * response.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * The field value consists of a challenge that indicates the authentication scheme and parameters applicable to the<a name="line.29"></a> +<span class="sourceLineNo">030</span> * proxy for this Request-URI.<a name="line.30"></a> +<span class="sourceLineNo">031</span> * <p class='bcode'><a name="line.31"></a> +<span class="sourceLineNo">032</span> * Proxy-Authenticate = "Proxy-Authenticate" ":" 1#challenge<a name="line.32"></a> +<span class="sourceLineNo">033</span> * </p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * <p><a name="line.34"></a> +<span class="sourceLineNo">035</span> * The HTTP access authentication process is described in "HTTP Authentication: Basic and Digest Access Authentication".<a name="line.35"></a> +<span class="sourceLineNo">036</span> * Unlike WWW-Authenticate, the Proxy-Authenticate header field applies only to the current connection and SHOULD NOT<a name="line.36"></a> +<span class="sourceLineNo">037</span> * be passed on to downstream clients.<a name="line.37"></a> +<span class="sourceLineNo">038</span> * However, an intermediate proxy might need to obtain its own credentials by requesting them from the downstream<a name="line.38"></a> +<span class="sourceLineNo">039</span> * client, which in some circumstances will appear as if the proxy is forwarding the Proxy-Authenticate header field.<a name="line.39"></a> +<span class="sourceLineNo">040</span> */<a name="line.40"></a> +<span class="sourceLineNo">041</span>public final class ProxyAuthenticate extends HeaderString {<a name="line.41"></a> +<span class="sourceLineNo">042</span><a name="line.42"></a> +<span class="sourceLineNo">043</span> /**<a name="line.43"></a> +<span class="sourceLineNo">044</span> * Returns a parsed <code>Proxy-Authenticate</code> header.<a name="line.44"></a> +<span class="sourceLineNo">045</span> *<a name="line.45"></a> +<span class="sourceLineNo">046</span> * @param value The <code>Proxy-Authenticate</code> header string.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * @return The parsed <code>Proxy-Authenticate</code> header, or <jk>null</jk> if the string was null.<a name="line.47"></a> +<span class="sourceLineNo">048</span> */<a name="line.48"></a> +<span class="sourceLineNo">049</span> public static ProxyAuthenticate forString(String value) {<a name="line.49"></a> +<span class="sourceLineNo">050</span> if (value == null)<a name="line.50"></a> +<span class="sourceLineNo">051</span> return null;<a name="line.51"></a> +<span class="sourceLineNo">052</span> return new ProxyAuthenticate(value);<a name="line.52"></a> +<span class="sourceLineNo">053</span> }<a name="line.53"></a> +<span class="sourceLineNo">054</span><a name="line.54"></a> +<span class="sourceLineNo">055</span> private ProxyAuthenticate(String value) {<a name="line.55"></a> +<span class="sourceLineNo">056</span> super(value);<a name="line.56"></a> +<span class="sourceLineNo">057</span> }<a name="line.57"></a> +<span class="sourceLineNo">058</span>}<a name="line.58"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthorization.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthorization.html b/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthorization.html new file mode 100644 index 0000000..f78e850 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ProxyAuthorization.html @@ -0,0 +1,132 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Proxy-Authorization</l> HTTP request header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * Authorization credentials for connecting to a proxy.<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * The Proxy-Authorization request-header field allows the client to identify itself (or its user) to a proxy which<a name="line.27"></a> +<span class="sourceLineNo">028</span> * requires authentication.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * The Proxy-Authorization field value consists of credentials containing the authentication information of the user<a name="line.29"></a> +<span class="sourceLineNo">030</span> * agent for the proxy and/or realm of the resource being requested.<a name="line.30"></a> +<span class="sourceLineNo">031</span> * <p class='bcode'><a name="line.31"></a> +<span class="sourceLineNo">032</span> * Proxy-Authorization = "Proxy-Authorization" ":" credentials<a name="line.32"></a> +<span class="sourceLineNo">033</span> * </p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * <p><a name="line.34"></a> +<span class="sourceLineNo">035</span> * The HTTP access authentication process is described in "HTTP Authentication: Basic and Digest Access Authentication".<a name="line.35"></a> +<span class="sourceLineNo">036</span> * Unlike Authorization, the Proxy-Authorization header field applies only to the next outbound proxy that demanded<a name="line.36"></a> +<span class="sourceLineNo">037</span> * authentication using the Proxy-Authenticate field.<a name="line.37"></a> +<span class="sourceLineNo">038</span> * When multiple proxies are used in a chain, the Proxy-Authorization header field is consumed by the first outbound<a name="line.38"></a> +<span class="sourceLineNo">039</span> * proxy that was expecting to receive credentials.<a name="line.39"></a> +<span class="sourceLineNo">040</span> * A proxy MAY relay the credentials from the client request to the next proxy if that is the mechanism by which the<a name="line.40"></a> +<span class="sourceLineNo">041</span> * proxies cooperatively authenticate a given request.<a name="line.41"></a> +<span class="sourceLineNo">042</span> */<a name="line.42"></a> +<span class="sourceLineNo">043</span>public final class ProxyAuthorization extends HeaderString {<a name="line.43"></a> +<span class="sourceLineNo">044</span><a name="line.44"></a> +<span class="sourceLineNo">045</span> /**<a name="line.45"></a> +<span class="sourceLineNo">046</span> * Returns a parsed <code>Proxy-Authorization</code> header.<a name="line.46"></a> +<span class="sourceLineNo">047</span> *<a name="line.47"></a> +<span class="sourceLineNo">048</span> * @param value The <code>Proxy-Authorization</code> header string.<a name="line.48"></a> +<span class="sourceLineNo">049</span> * @return The parsed <code>Proxy-Authorization</code> header, or <jk>null</jk> if the string was null.<a name="line.49"></a> +<span class="sourceLineNo">050</span> */<a name="line.50"></a> +<span class="sourceLineNo">051</span> public static ProxyAuthorization forString(String value) {<a name="line.51"></a> +<span class="sourceLineNo">052</span> if (value == null)<a name="line.52"></a> +<span class="sourceLineNo">053</span> return null;<a name="line.53"></a> +<span class="sourceLineNo">054</span> return new ProxyAuthorization(value);<a name="line.54"></a> +<span class="sourceLineNo">055</span> }<a name="line.55"></a> +<span class="sourceLineNo">056</span><a name="line.56"></a> +<span class="sourceLineNo">057</span> private ProxyAuthorization(String value) {<a name="line.57"></a> +<span class="sourceLineNo">058</span> super(value);<a name="line.58"></a> +<span class="sourceLineNo">059</span> }<a name="line.59"></a> +<span class="sourceLineNo">060</span>}<a name="line.60"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/Range.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/Range.html b/content/site/apidocs/src-html/org/apache/juneau/http/Range.html new file mode 100644 index 0000000..0511540 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/Range.html @@ -0,0 +1,208 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Range</l> HTTP request header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * Request only part of an entity. Bytes are numbered from 0.<a name="line.18"></a> +<span class="sourceLineNo">019</span> *<a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='figure'>Example</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span> * Range: bytes=500-999<a name="line.22"></a> +<span class="sourceLineNo">023</span> * </p><a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is<a name="line.27"></a> +<span class="sourceLineNo">028</span> * meaningful for any HTTP entity.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * (However, not all clients and servers need to support byte- range operations.)<a name="line.29"></a> +<span class="sourceLineNo">030</span> * <p><a name="line.30"></a> +<span class="sourceLineNo">031</span> * Byte range specifications in HTTP apply to the sequence of bytes in the entity-body (not necessarily the same as the<a name="line.31"></a> +<span class="sourceLineNo">032</span> * message-body).<a name="line.32"></a> +<span class="sourceLineNo">033</span> * <p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * A byte range operation MAY specify a single range of bytes, or a set of ranges within a single entity.<a name="line.34"></a> +<span class="sourceLineNo">035</span> * <p class='bcode'><a name="line.35"></a> +<span class="sourceLineNo">036</span> * ranges-specifier = byte-ranges-specifier<a name="line.36"></a> +<span class="sourceLineNo">037</span> * byte-ranges-specifier = bytes-unit "=" byte-range-set<a name="line.37"></a> +<span class="sourceLineNo">038</span> * byte-range-set = 1#( byte-range-spec | suffix-byte-range-spec )<a name="line.38"></a> +<span class="sourceLineNo">039</span> * byte-range-spec = first-byte-pos "-" [last-byte-pos]<a name="line.39"></a> +<span class="sourceLineNo">040</span> * first-byte-pos = 1*DIGIT<a name="line.40"></a> +<span class="sourceLineNo">041</span> * last-byte-pos = 1*DIGIT<a name="line.41"></a> +<span class="sourceLineNo">042</span> * </p><a name="line.42"></a> +<span class="sourceLineNo">043</span> * <p><a name="line.43"></a> +<span class="sourceLineNo">044</span> * The first-byte-pos value in a byte-range-spec gives the byte-offset of the first byte in a range.<a name="line.44"></a> +<span class="sourceLineNo">045</span> * The last-byte-pos value gives the byte-offset of the last byte in the range; that is, the byte positions specified<a name="line.45"></a> +<span class="sourceLineNo">046</span> * are inclusive.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * Byte offsets start at zero.<a name="line.47"></a> +<span class="sourceLineNo">048</span> * <p><a name="line.48"></a> +<span class="sourceLineNo">049</span> * If the last-byte-pos value is present, it MUST be greater than or equal to the first-byte-pos in that<a name="line.49"></a> +<span class="sourceLineNo">050</span> * byte-range-spec, or the byte- range-spec is syntactically invalid.<a name="line.50"></a> +<span class="sourceLineNo">051</span> * The recipient of a byte-range- set that includes one or more syntactically invalid byte-range-spec values MUST<a name="line.51"></a> +<span class="sourceLineNo">052</span> * ignore the header field that includes that byte-range-set.<a name="line.52"></a> +<span class="sourceLineNo">053</span> * <p><a name="line.53"></a> +<span class="sourceLineNo">054</span> * If the last-byte-pos value is absent, or if the value is greater than or equal to the current length of the<a name="line.54"></a> +<span class="sourceLineNo">055</span> * entity-body, last-byte-pos is taken to be equal to one less than the current length of the entity-body in bytes.<a name="line.55"></a> +<span class="sourceLineNo">056</span> * <p><a name="line.56"></a> +<span class="sourceLineNo">057</span> * By its choice of last-byte-pos, a client can limit the number of bytes retrieved without knowing the size of the<a name="line.57"></a> +<span class="sourceLineNo">058</span> * entity.<a name="line.58"></a> +<span class="sourceLineNo">059</span> * <p class='bcode'><a name="line.59"></a> +<span class="sourceLineNo">060</span> * suffix-byte-range-spec = "-" suffix-length<a name="line.60"></a> +<span class="sourceLineNo">061</span> * suffix-length = 1*DIGIT<a name="line.61"></a> +<span class="sourceLineNo">062</span> * </p><a name="line.62"></a> +<span class="sourceLineNo">063</span> * <p><a name="line.63"></a> +<span class="sourceLineNo">064</span> * A suffix-byte-range-spec is used to specify the suffix of the entity-body, of a length given by the suffix-length<a name="line.64"></a> +<span class="sourceLineNo">065</span> * value.<a name="line.65"></a> +<span class="sourceLineNo">066</span> * (That is, this form specifies the last N bytes of an entity-body.)<a name="line.66"></a> +<span class="sourceLineNo">067</span> * If the entity is shorter than the specified suffix-length, the entire entity-body is used.<a name="line.67"></a> +<span class="sourceLineNo">068</span> * <p><a name="line.68"></a> +<span class="sourceLineNo">069</span> * If a syntactically valid byte-range-set includes at least one byte- range-spec whose first-byte-pos is less than the<a name="line.69"></a> +<span class="sourceLineNo">070</span> * current length of the entity-body, or at least one suffix-byte-range-spec with a non-zero suffix-length, then the<a name="line.70"></a> +<span class="sourceLineNo">071</span> * byte-range-set is satisfiable.<a name="line.71"></a> +<span class="sourceLineNo">072</span> * Otherwise, the byte-range-set is unsatisfiable.<a name="line.72"></a> +<span class="sourceLineNo">073</span> * If the byte-range-set is unsatisfiable, the server SHOULD return a response with a status of 416 (Requested range<a name="line.73"></a> +<span class="sourceLineNo">074</span> * not satisfiable).<a name="line.74"></a> +<span class="sourceLineNo">075</span> * Otherwise, the server SHOULD return a response with a status of 206 (Partial Content) containing the satisfiable<a name="line.75"></a> +<span class="sourceLineNo">076</span> * ranges of the entity-body.<a name="line.76"></a> +<span class="sourceLineNo">077</span> * <p><a name="line.77"></a> +<span class="sourceLineNo">078</span> * Examples of byte-ranges-specifier values (assuming an entity-body of length 10000):<a name="line.78"></a> +<span class="sourceLineNo">079</span> * <p class='bcode'><a name="line.79"></a> +<span class="sourceLineNo">080</span> * - The first 500 bytes (byte offsets 0-499, inclusive): bytes=0-499<a name="line.80"></a> +<span class="sourceLineNo">081</span> * - The second 500 bytes (byte offsets 500-999, inclusive): bytes=500-999<a name="line.81"></a> +<span class="sourceLineNo">082</span> * - The final 500 bytes (byte offsets 9500-9999, inclusive): bytes=-500<a name="line.82"></a> +<span class="sourceLineNo">083</span> * - Or bytes=9500-<a name="line.83"></a> +<span class="sourceLineNo">084</span> * - The first and last bytes only (bytes 0 and 9999): bytes=0-0,-1<a name="line.84"></a> +<span class="sourceLineNo">085</span> * - Several legal but not canonical specifications of the second 500 bytes (byte offsets 500-999, inclusive):<a name="line.85"></a> +<span class="sourceLineNo">086</span> * bytes=500-600,601-999<a name="line.86"></a> +<span class="sourceLineNo">087</span> * bytes=500-700,601-999<a name="line.87"></a> +<span class="sourceLineNo">088</span> * </p><a name="line.88"></a> +<span class="sourceLineNo">089</span> * <p><a name="line.89"></a> +<span class="sourceLineNo">090</span> * HTTP retrieval requests using conditional or unconditional GET methods MAY request one or more sub-ranges of the<a name="line.90"></a> +<span class="sourceLineNo">091</span> * entity, instead of the entire entity, using the Range request header, which applies to the entity returned as the r<a name="line.91"></a> +<span class="sourceLineNo">092</span> * esult of the request:<a name="line.92"></a> +<span class="sourceLineNo">093</span> * <p class='bcode'><a name="line.93"></a> +<span class="sourceLineNo">094</span> * Range = "Range" ":" ranges-specifier<a name="line.94"></a> +<span class="sourceLineNo">095</span> * </p><a name="line.95"></a> +<span class="sourceLineNo">096</span> * <p><a name="line.96"></a> +<span class="sourceLineNo">097</span> * A server MAY ignore the Range header.<a name="line.97"></a> +<span class="sourceLineNo">098</span> * However, HTTP/1.1 origin servers and intermediate caches ought to support byte ranges when possible, since Range<a name="line.98"></a> +<span class="sourceLineNo">099</span> * supports efficient recovery from partially failed transfers, and supports efficient partial retrieval of large<a name="line.99"></a> +<span class="sourceLineNo">100</span> * entities.<a name="line.100"></a> +<span class="sourceLineNo">101</span> * <p><a name="line.101"></a> +<span class="sourceLineNo">102</span> * If the server supports the Range header and the specified range or ranges are appropriate for the entity:<a name="line.102"></a> +<span class="sourceLineNo">103</span> * <ul><a name="line.103"></a> +<span class="sourceLineNo">104</span> * <li>The presence of a Range header in an unconditional GET modifies what is returned if the GET is otherwise<a name="line.104"></a> +<span class="sourceLineNo">105</span> * successful.<a name="line.105"></a> +<span class="sourceLineNo">106</span> * In other words, the response carries a status code of 206 (Partial Content) instead of 200 (OK).<a name="line.106"></a> +<span class="sourceLineNo">107</span> * <li>The presence of a Range header in a conditional GET (a request using one or both of If-Modified-Since and<a name="line.107"></a> +<span class="sourceLineNo">108</span> * If-None-Match, or one or both of If-Unmodified-Since and If-Match) modifies what is returned if the GET is<a name="line.108"></a> +<span class="sourceLineNo">109</span> * otherwise successful and the condition is true. It does not affect the 304 (Not Modified) response returned if<a name="line.109"></a> +<span class="sourceLineNo">110</span> * the conditional is false.<a name="line.110"></a> +<span class="sourceLineNo">111</span> * </ul><a name="line.111"></a> +<span class="sourceLineNo">112</span> * In some cases, it might be more appropriate to use the If-Range header (see section 14.27) in addition to the Range<a name="line.112"></a> +<span class="sourceLineNo">113</span> * header.<a name="line.113"></a> +<span class="sourceLineNo">114</span> * <p><a name="line.114"></a> +<span class="sourceLineNo">115</span> * If a proxy that supports ranges receives a Range request, forwards the request to an inbound server, and receives an<a name="line.115"></a> +<span class="sourceLineNo">116</span> * entire entity in reply, it SHOULD only return the requested range to its client.<a name="line.116"></a> +<span class="sourceLineNo">117</span> * It SHOULD store the entire received response in its cache if that is consistent with its cache allocation policies.<a name="line.117"></a> +<span class="sourceLineNo">118</span> */<a name="line.118"></a> +<span class="sourceLineNo">119</span>public final class Range extends HeaderString {<a name="line.119"></a> +<span class="sourceLineNo">120</span><a name="line.120"></a> +<span class="sourceLineNo">121</span> /**<a name="line.121"></a> +<span class="sourceLineNo">122</span> * Returns a parsed <code>Range</code> header.<a name="line.122"></a> +<span class="sourceLineNo">123</span> *<a name="line.123"></a> +<span class="sourceLineNo">124</span> * @param value The <code>Range</code> header string.<a name="line.124"></a> +<span class="sourceLineNo">125</span> * @return The parsed <code>Range</code> header, or <jk>null</jk> if the string was null.<a name="line.125"></a> +<span class="sourceLineNo">126</span> */<a name="line.126"></a> +<span class="sourceLineNo">127</span> public static Range forString(String value) {<a name="line.127"></a> +<span class="sourceLineNo">128</span> if (value == null)<a name="line.128"></a> +<span class="sourceLineNo">129</span> return null;<a name="line.129"></a> +<span class="sourceLineNo">130</span> return new Range(value);<a name="line.130"></a> +<span class="sourceLineNo">131</span> }<a name="line.131"></a> +<span class="sourceLineNo">132</span><a name="line.132"></a> +<span class="sourceLineNo">133</span> private Range(String value) {<a name="line.133"></a> +<span class="sourceLineNo">134</span> super(value);<a name="line.134"></a> +<span class="sourceLineNo">135</span> }<a name="line.135"></a> +<span class="sourceLineNo">136</span>}<a name="line.136"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/Referer.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/Referer.html b/content/site/apidocs/src-html/org/apache/juneau/http/Referer.html new file mode 100644 index 0000000..74c64b6 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/Referer.html @@ -0,0 +1,137 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>/**<a name="line.15"></a> +<span class="sourceLineNo">016</span> * Represents a parsed <l>Referer</l> HTTP request header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> * <p><a name="line.17"></a> +<span class="sourceLineNo">018</span> * This is the address of the previous web page from which a link to the currently requested page was followed.<a name="line.18"></a> +<span class="sourceLineNo">019</span> * (The word âreferrerâ has been misspelled in the RFC as well as in most implementations to the point that it has<a name="line.19"></a> +<span class="sourceLineNo">020</span> * become standard usage and is considered correct terminology)<a name="line.20"></a> +<span class="sourceLineNo">021</span> *<a name="line.21"></a> +<span class="sourceLineNo">022</span> * <h6 class='figure'>Example</h6><a name="line.22"></a> +<span class="sourceLineNo">023</span> * <p class='bcode'><a name="line.23"></a> +<span class="sourceLineNo">024</span> * Referer: http://en.wikipedia.org/wiki/Main_Page<a name="line.24"></a> +<span class="sourceLineNo">025</span> * </p><a name="line.25"></a> +<span class="sourceLineNo">026</span> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.27"></a> +<span class="sourceLineNo">028</span> *<a name="line.28"></a> +<span class="sourceLineNo">029</span> * The Referer[sic] request-header field allows the client to specify, for the server's benefit, the address (URI) of<a name="line.29"></a> +<span class="sourceLineNo">030</span> * the resource from which the Request-URI was obtained (the "referrer", although the header field is misspelled.)<a name="line.30"></a> +<span class="sourceLineNo">031</span> * The Referer request-header allows a server to generate lists of back-links to resources for interest, logging,<a name="line.31"></a> +<span class="sourceLineNo">032</span> * optimized caching, etc.<a name="line.32"></a> +<span class="sourceLineNo">033</span> * It also allows obsolete or mistyped links to be traced for maintenance.<a name="line.33"></a> +<span class="sourceLineNo">034</span> * The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI,<a name="line.34"></a> +<span class="sourceLineNo">035</span> * such as input from the user keyboard.<a name="line.35"></a> +<span class="sourceLineNo">036</span> * <p class='bcode'><a name="line.36"></a> +<span class="sourceLineNo">037</span> * Referer = "Referer" ":" ( absoluteURI | relativeURI )<a name="line.37"></a> +<span class="sourceLineNo">038</span> * </p><a name="line.38"></a> +<span class="sourceLineNo">039</span> * <p><a name="line.39"></a> +<span class="sourceLineNo">040</span> * Example:<a name="line.40"></a> +<span class="sourceLineNo">041</span> * <p class='bcode'><a name="line.41"></a> +<span class="sourceLineNo">042</span> * Referer: http://www.w3.org/hypertext/DataSources/Overview.html<a name="line.42"></a> +<span class="sourceLineNo">043</span> * </p><a name="line.43"></a> +<span class="sourceLineNo">044</span> * <p><a name="line.44"></a> +<span class="sourceLineNo">045</span> * If the field value is a relative URI, it SHOULD be interpreted relative to the Request-URI.<a name="line.45"></a> +<span class="sourceLineNo">046</span> * The URI MUST NOT include a fragment. See section 15.1.3 for security considerations.<a name="line.46"></a> +<span class="sourceLineNo">047</span> */<a name="line.47"></a> +<span class="sourceLineNo">048</span>public final class Referer extends HeaderUri {<a name="line.48"></a> +<span class="sourceLineNo">049</span><a name="line.49"></a> +<span class="sourceLineNo">050</span> /**<a name="line.50"></a> +<span class="sourceLineNo">051</span> * Returns a parsed <code>Referer</code> header.<a name="line.51"></a> +<span class="sourceLineNo">052</span> *<a name="line.52"></a> +<span class="sourceLineNo">053</span> * @param value The <code>Referer</code> header string.<a name="line.53"></a> +<span class="sourceLineNo">054</span> * @return The parsed <code>Referer</code> header, or <jk>null</jk> if the string was null.<a name="line.54"></a> +<span class="sourceLineNo">055</span> */<a name="line.55"></a> +<span class="sourceLineNo">056</span> public static Referer forString(String value) {<a name="line.56"></a> +<span class="sourceLineNo">057</span> if (value == null)<a name="line.57"></a> +<span class="sourceLineNo">058</span> return null;<a name="line.58"></a> +<span class="sourceLineNo">059</span> return new Referer(value);<a name="line.59"></a> +<span class="sourceLineNo">060</span> }<a name="line.60"></a> +<span class="sourceLineNo">061</span><a name="line.61"></a> +<span class="sourceLineNo">062</span> private Referer(String value) {<a name="line.62"></a> +<span class="sourceLineNo">063</span> super(value);<a name="line.63"></a> +<span class="sourceLineNo">064</span> }<a name="line.64"></a> +<span class="sourceLineNo">065</span>}<a name="line.65"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/RetryAfter.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/RetryAfter.html b/content/site/apidocs/src-html/org/apache/juneau/http/RetryAfter.html new file mode 100644 index 0000000..f8853de --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/RetryAfter.html @@ -0,0 +1,166 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>// ***************************************************************************************************************************<a name="line.1"></a> +<span class="sourceLineNo">002</span>// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *<a name="line.2"></a> +<span class="sourceLineNo">003</span>// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *<a name="line.3"></a> +<span class="sourceLineNo">004</span>// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *<a name="line.4"></a> +<span class="sourceLineNo">005</span>// * with the License. You may obtain a copy of the License at *<a name="line.5"></a> +<span class="sourceLineNo">006</span>// * *<a name="line.6"></a> +<span class="sourceLineNo">007</span>// * http://www.apache.org/licenses/LICENSE-2.0 *<a name="line.7"></a> +<span class="sourceLineNo">008</span>// * *<a name="line.8"></a> +<span class="sourceLineNo">009</span>// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *<a name="line.9"></a> +<span class="sourceLineNo">010</span>// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *<a name="line.10"></a> +<span class="sourceLineNo">011</span>// * specific language governing permissions and limitations under the License. *<a name="line.11"></a> +<span class="sourceLineNo">012</span>// ***************************************************************************************************************************<a name="line.12"></a> +<span class="sourceLineNo">013</span>package org.apache.juneau.http;<a name="line.13"></a> +<span class="sourceLineNo">014</span><a name="line.14"></a> +<span class="sourceLineNo">015</span>import static org.apache.juneau.internal.StringUtils.*;<a name="line.15"></a> +<span class="sourceLineNo">016</span><a name="line.16"></a> +<span class="sourceLineNo">017</span>import org.apache.juneau.internal.*;<a name="line.17"></a> +<span class="sourceLineNo">018</span><a name="line.18"></a> +<span class="sourceLineNo">019</span>/**<a name="line.19"></a> +<span class="sourceLineNo">020</span> * Represents a parsed <l>Retry-After</l> HTTP response header.<a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p><a name="line.21"></a> +<span class="sourceLineNo">022</span> * If an entity is temporarily unavailable, this instructs the client to try again later.<a name="line.22"></a> +<span class="sourceLineNo">023</span> * Value could be a specified period of time (in seconds) or a HTTP-date.<a name="line.23"></a> +<span class="sourceLineNo">024</span> *<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <h6 class='figure'>Example</h6><a name="line.25"></a> +<span class="sourceLineNo">026</span> * <p class='bcode'><a name="line.26"></a> +<span class="sourceLineNo">027</span> * Retry-After: 120<a name="line.27"></a> +<span class="sourceLineNo">028</span> * Retry-After: Fri, 07 Nov 2014 23:59:59 GMT<a name="line.28"></a> +<span class="sourceLineNo">029</span> * </p><a name="line.29"></a> +<span class="sourceLineNo">030</span> *<a name="line.30"></a> +<span class="sourceLineNo">031</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.31"></a> +<span class="sourceLineNo">032</span> * The Retry-After response-header field can be used with a 503 (Service Unavailable) response to indicate how long the<a name="line.32"></a> +<span class="sourceLineNo">033</span> * service is expected to be unavailable to the requesting client.<a name="line.33"></a> +<span class="sourceLineNo">034</span> * This field MAY also be used with any 3xx (Redirection) response to indicate the minimum time the user-agent is asked<a name="line.34"></a> +<span class="sourceLineNo">035</span> * wait before issuing the redirected request.<a name="line.35"></a> +<span class="sourceLineNo">036</span> * The value of this field can be either an HTTP-date or an integer number of seconds (in decimal) after the time of the<a name="line.36"></a> +<span class="sourceLineNo">037</span> * response.<a name="line.37"></a> +<span class="sourceLineNo">038</span> * <p class='bcode'><a name="line.38"></a> +<span class="sourceLineNo">039</span> * Retry-After = "Retry-After" ":" ( HTTP-date | delta-seconds )<a name="line.39"></a> +<span class="sourceLineNo">040</span> * </p><a name="line.40"></a> +<span class="sourceLineNo">041</span> * <p><a name="line.41"></a> +<span class="sourceLineNo">042</span> * Two examples of its use are<a name="line.42"></a> +<span class="sourceLineNo">043</span> * <p class='bcode'><a name="line.43"></a> +<span class="sourceLineNo">044</span> * Retry-After: Fri, 31 Dec 1999 23:59:59 GMT<a name="line.44"></a> +<span class="sourceLineNo">045</span> * Retry-After: 120<a name="line.45"></a> +<span class="sourceLineNo">046</span> * </p><a name="line.46"></a> +<span class="sourceLineNo">047</span> * <p><a name="line.47"></a> +<span class="sourceLineNo">048</span> * In the latter example, the delay is 2 minutes.<a name="line.48"></a> +<span class="sourceLineNo">049</span> */<a name="line.49"></a> +<span class="sourceLineNo">050</span>public final class RetryAfter extends HeaderString {<a name="line.50"></a> +<span class="sourceLineNo">051</span><a name="line.51"></a> +<span class="sourceLineNo">052</span> /**<a name="line.52"></a> +<span class="sourceLineNo">053</span> * Returns a parsed <code>Retry-After</code> header.<a name="line.53"></a> +<span class="sourceLineNo">054</span> *<a name="line.54"></a> +<span class="sourceLineNo">055</span> * @param value The <code>Retry-After</code> header string.<a name="line.55"></a> +<span class="sourceLineNo">056</span> * @return The parsed <code>Retry-After</code> header, or <jk>null</jk> if the string was null.<a name="line.56"></a> +<span class="sourceLineNo">057</span> */<a name="line.57"></a> +<span class="sourceLineNo">058</span> public static RetryAfter forString(String value) {<a name="line.58"></a> +<span class="sourceLineNo">059</span> if (value == null)<a name="line.59"></a> +<span class="sourceLineNo">060</span> return null;<a name="line.60"></a> +<span class="sourceLineNo">061</span> return new RetryAfter(value);<a name="line.61"></a> +<span class="sourceLineNo">062</span> }<a name="line.62"></a> +<span class="sourceLineNo">063</span><a name="line.63"></a> +<span class="sourceLineNo">064</span> private RetryAfter(String value) {<a name="line.64"></a> +<span class="sourceLineNo">065</span> super(value);<a name="line.65"></a> +<span class="sourceLineNo">066</span> }<a name="line.66"></a> +<span class="sourceLineNo">067</span><a name="line.67"></a> +<span class="sourceLineNo">068</span> /**<a name="line.68"></a> +<span class="sourceLineNo">069</span> * Returns this header value as a {@link java.util.Date} object.<a name="line.69"></a> +<span class="sourceLineNo">070</span> * @return This header value as a {@link java.util.Date} object, or <jk>null</jk> if the value is not a date.<a name="line.70"></a> +<span class="sourceLineNo">071</span> */<a name="line.71"></a> +<span class="sourceLineNo">072</span> public java.util.Date asDate() {<a name="line.72"></a> +<span class="sourceLineNo">073</span> char c0 = charAt(value, 0);<a name="line.73"></a> +<span class="sourceLineNo">074</span> if (c0 >= '0' && c0 <= '9')<a name="line.74"></a> +<span class="sourceLineNo">075</span> return null;<a name="line.75"></a> +<span class="sourceLineNo">076</span> return DateUtils.parseDate(toString());<a name="line.76"></a> +<span class="sourceLineNo">077</span> }<a name="line.77"></a> +<span class="sourceLineNo">078</span><a name="line.78"></a> +<span class="sourceLineNo">079</span> /**<a name="line.79"></a> +<span class="sourceLineNo">080</span> * Returns this header value as an integer.<a name="line.80"></a> +<span class="sourceLineNo">081</span> * @return This header value as a integer, or <code>-1</code> if the value is not an integer.<a name="line.81"></a> +<span class="sourceLineNo">082</span> */<a name="line.82"></a> +<span class="sourceLineNo">083</span> public int asInt() {<a name="line.83"></a> +<span class="sourceLineNo">084</span> char c0 = charAt(value, 0);<a name="line.84"></a> +<span class="sourceLineNo">085</span> if (c0 >= '0' && c0 <= '9') {<a name="line.85"></a> +<span class="sourceLineNo">086</span> try {<a name="line.86"></a> +<span class="sourceLineNo">087</span> return Integer.parseInt(value);<a name="line.87"></a> +<span class="sourceLineNo">088</span> } catch (NumberFormatException e) {<a name="line.88"></a> +<span class="sourceLineNo">089</span> return -1;<a name="line.89"></a> +<span class="sourceLineNo">090</span> }<a name="line.90"></a> +<span class="sourceLineNo">091</span> }<a name="line.91"></a> +<span class="sourceLineNo">092</span> return -1;<a name="line.92"></a> +<span class="sourceLineNo">093</span> }<a name="line.93"></a> +<span class="sourceLineNo">094</span>}<a name="line.94"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html>
