http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/f1f17bc3/content/site/apidocs/src-html/org/apache/juneau/http/CacheControl.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/CacheControl.html b/content/site/apidocs/src-html/org/apache/juneau/http/CacheControl.html new file mode 100644 index 0000000..7580bcf --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/CacheControl.html @@ -0,0 +1,174 @@ +<!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>Cache-Control</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> * Used to specify directives that must be obeyed by all caching mechanisms 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> * Cache-Control: 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> *<a name="line.26"></a> +<span class="sourceLineNo">027</span> * The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms<a name="line.27"></a> +<span class="sourceLineNo">028</span> * along the request/response chain.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * The directives specify behavior intended to prevent caches from adversely interfering with the request or response.<a name="line.29"></a> +<span class="sourceLineNo">030</span> * These directives typically override the default caching algorithms.<a name="line.30"></a> +<span class="sourceLineNo">031</span> * Cache directives are unidirectional in that the presence of a directive in a request does not imply that the same<a name="line.31"></a> +<span class="sourceLineNo">032</span> * directive is to be given in the response.<a name="line.32"></a> +<span class="sourceLineNo">033</span> * <p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * Note that HTTP/1.0 caches might not implement Cache-Control and might only implement Pragma: no-cache (see section<a name="line.34"></a> +<span class="sourceLineNo">035</span> * 14.32).<a name="line.35"></a> +<span class="sourceLineNo">036</span> * <p><a name="line.36"></a> +<span class="sourceLineNo">037</span> * Cache directives MUST be passed through by a proxy or gateway application, regardless of their significance to that<a name="line.37"></a> +<span class="sourceLineNo">038</span> * application, since the directives might be applicable to all recipients along the request/response chain.<a name="line.38"></a> +<span class="sourceLineNo">039</span> * It is not possible to specify a cache- directive for a specific cache.<a name="line.39"></a> +<span class="sourceLineNo">040</span> *<a name="line.40"></a> +<span class="sourceLineNo">041</span> * <p class='bcode'><a name="line.41"></a> +<span class="sourceLineNo">042</span> * Cache-Control = "Cache-Control" ":" 1#cache-directive<a name="line.42"></a> +<span class="sourceLineNo">043</span> * cache-directive = cache-request-directive<a name="line.43"></a> +<span class="sourceLineNo">044</span> * | cache-response-directive<a name="line.44"></a> +<span class="sourceLineNo">045</span> * cache-request-directive =<a name="line.45"></a> +<span class="sourceLineNo">046</span> * "no-cache" ; Section 14.9.1<a name="line.46"></a> +<span class="sourceLineNo">047</span> * | "no-store" ; Section 14.9.2<a name="line.47"></a> +<span class="sourceLineNo">048</span> * | "max-age" "=" delta-seconds ; Section 14.9.3, 14.9.4<a name="line.48"></a> +<span class="sourceLineNo">049</span> * | "max-stale" [ "=" delta-seconds ] ; Section 14.9.3<a name="line.49"></a> +<span class="sourceLineNo">050</span> * | "min-fresh" "=" delta-seconds ; Section 14.9.3<a name="line.50"></a> +<span class="sourceLineNo">051</span> * | "no-transform" ; Section 14.9.5<a name="line.51"></a> +<span class="sourceLineNo">052</span> * | "only-if-cached" ; Section 14.9.4<a name="line.52"></a> +<span class="sourceLineNo">053</span> * | cache-extension ; Section 14.9.6<a name="line.53"></a> +<span class="sourceLineNo">054</span> * cache-response-directive =<a name="line.54"></a> +<span class="sourceLineNo">055</span> * "public" ; Section 14.9.1<a name="line.55"></a> +<span class="sourceLineNo">056</span> * | "private" [ "=" <"> 1#field-name <"> ] ; Section 14.9.1<a name="line.56"></a> +<span class="sourceLineNo">057</span> * | "no-cache" [ "=" <"> 1#field-name <"> ]; Section 14.9.1<a name="line.57"></a> +<span class="sourceLineNo">058</span> * | "no-store" ; Section 14.9.2<a name="line.58"></a> +<span class="sourceLineNo">059</span> * | "no-transform" ; Section 14.9.5<a name="line.59"></a> +<span class="sourceLineNo">060</span> * | "must-revalidate" ; Section 14.9.4<a name="line.60"></a> +<span class="sourceLineNo">061</span> * | "proxy-revalidate" ; Section 14.9.4<a name="line.61"></a> +<span class="sourceLineNo">062</span> * | "max-age" "=" delta-seconds ; Section 14.9.3<a name="line.62"></a> +<span class="sourceLineNo">063</span> * | "s-maxage" "=" delta-seconds ; Section 14.9.3<a name="line.63"></a> +<span class="sourceLineNo">064</span> * | cache-extension ; Section 14.9.6<a name="line.64"></a> +<span class="sourceLineNo">065</span> * cache-extension = token [ "=" ( token | quoted-string ) ]<a name="line.65"></a> +<span class="sourceLineNo">066</span> * </p><a name="line.66"></a> +<span class="sourceLineNo">067</span> * <p><a name="line.67"></a> +<span class="sourceLineNo">068</span> * When a directive appears without any 1#field-name parameter, the directive applies to the entire request or response.<a name="line.68"></a> +<span class="sourceLineNo">069</span> * When such a directive appears with a 1#field-name parameter, it applies only to the named field or fields, and not<a name="line.69"></a> +<span class="sourceLineNo">070</span> * to the rest of the request or response. This mechanism supports extensibility; implementations of future versions<a name="line.70"></a> +<span class="sourceLineNo">071</span> * of the HTTP protocol might apply these directives to header fields not defined in HTTP/1.1.<a name="line.71"></a> +<span class="sourceLineNo">072</span> * <p><a name="line.72"></a> +<span class="sourceLineNo">073</span> * The cache-control directives can be broken down into these general categories:<a name="line.73"></a> +<span class="sourceLineNo">074</span> * <ul><a name="line.74"></a> +<span class="sourceLineNo">075</span> * <li>Restrictions on what are cacheable; these may only be imposed by the origin server.<a name="line.75"></a> +<span class="sourceLineNo">076</span> * <li>Restrictions on what may be stored by a cache; these may be imposed by either the origin server or the user<a name="line.76"></a> +<span class="sourceLineNo">077</span> * agent.<a name="line.77"></a> +<span class="sourceLineNo">078</span> * <li>Modifications of the basic expiration mechanism; these may be imposed by either the origin server or the<a name="line.78"></a> +<span class="sourceLineNo">079</span> * user agent.<a name="line.79"></a> +<span class="sourceLineNo">080</span> * <li>Controls over cache revalidation and reload; these may only be imposed by a user agent.<a name="line.80"></a> +<span class="sourceLineNo">081</span> * <li>Control over transformation of entities.<a name="line.81"></a> +<span class="sourceLineNo">082</span> * <li>Extensions to the caching system.<a name="line.82"></a> +<span class="sourceLineNo">083</span> * </ul><a name="line.83"></a> +<span class="sourceLineNo">084</span> */<a name="line.84"></a> +<span class="sourceLineNo">085</span>public final class CacheControl extends HeaderString {<a name="line.85"></a> +<span class="sourceLineNo">086</span><a name="line.86"></a> +<span class="sourceLineNo">087</span> /**<a name="line.87"></a> +<span class="sourceLineNo">088</span> * Returns a parsed <code>Cache-Control</code> header.<a name="line.88"></a> +<span class="sourceLineNo">089</span> *<a name="line.89"></a> +<span class="sourceLineNo">090</span> * @param value The <code>Cache-Control</code> header string.<a name="line.90"></a> +<span class="sourceLineNo">091</span> * @return The parsed <code>Cache-Control</code> header, or <jk>null</jk> if the string was null.<a name="line.91"></a> +<span class="sourceLineNo">092</span> */<a name="line.92"></a> +<span class="sourceLineNo">093</span> public static CacheControl forString(String value) {<a name="line.93"></a> +<span class="sourceLineNo">094</span> if (value == null)<a name="line.94"></a> +<span class="sourceLineNo">095</span> return null;<a name="line.95"></a> +<span class="sourceLineNo">096</span> return new CacheControl(value);<a name="line.96"></a> +<span class="sourceLineNo">097</span> }<a name="line.97"></a> +<span class="sourceLineNo">098</span><a name="line.98"></a> +<span class="sourceLineNo">099</span> private CacheControl(String value) {<a name="line.99"></a> +<span class="sourceLineNo">100</span> super(value);<a name="line.100"></a> +<span class="sourceLineNo">101</span> }<a name="line.101"></a> +<span class="sourceLineNo">102</span>}<a name="line.102"></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/Connection.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/Connection.html b/content/site/apidocs/src-html/org/apache/juneau/http/Connection.html new file mode 100644 index 0000000..cd244d3 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/Connection.html @@ -0,0 +1,178 @@ +<!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>Connection</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> * Control options for the current connection and list of hop-by-hop request fields.<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> * Connection: keep-alive<a name="line.22"></a> +<span class="sourceLineNo">023</span> * Connection: Upgrade<a name="line.23"></a> +<span class="sourceLineNo">024</span> * </p><a name="line.24"></a> +<span class="sourceLineNo">025</span> *<a name="line.25"></a> +<span class="sourceLineNo">026</span> * <h6 class='topic'>RFC2616 Specification</h6><a name="line.26"></a> +<span class="sourceLineNo">027</span> *<a name="line.27"></a> +<span class="sourceLineNo">028</span> * The Connection general-header field allows the sender to specify options that are desired for that particular<a name="line.28"></a> +<span class="sourceLineNo">029</span> * connection and MUST NOT be communicated by proxies over further connections.<a name="line.29"></a> +<span class="sourceLineNo">030</span> * <p><a name="line.30"></a> +<span class="sourceLineNo">031</span> * The Connection header has the following grammar:<a name="line.31"></a> +<span class="sourceLineNo">032</span> * <p class='bcode'><a name="line.32"></a> +<span class="sourceLineNo">033</span> * Connection = "Connection" ":" 1#(connection-token)<a name="line.33"></a> +<span class="sourceLineNo">034</span> * connection-token = token<a name="line.34"></a> +<span class="sourceLineNo">035</span> * </p><a name="line.35"></a> +<span class="sourceLineNo">036</span> * <p><a name="line.36"></a> +<span class="sourceLineNo">037</span> * HTTP/1.1 proxies MUST parse the Connection header field before a message is forwarded and, for each connection-token<a name="line.37"></a> +<span class="sourceLineNo">038</span> * in this field, remove any header field(s) from the message with the same name as the connection-token.<a name="line.38"></a> +<span class="sourceLineNo">039</span> * Connection options are signaled by the presence of a connection-token in the Connection header field, not by any<a name="line.39"></a> +<span class="sourceLineNo">040</span> * corresponding additional header field(s), since the additional header field may not be sent if there are no<a name="line.40"></a> +<span class="sourceLineNo">041</span> * parameters associated with that connection option.<a name="line.41"></a> +<span class="sourceLineNo">042</span> * <p><a name="line.42"></a> +<span class="sourceLineNo">043</span> * Message headers listed in the Connection header MUST NOT include end-to-end headers, such as Cache-Control.<a name="line.43"></a> +<span class="sourceLineNo">044</span> * <p><a name="line.44"></a> +<span class="sourceLineNo">045</span> * HTTP/1.1 defines the "close" connection option for the sender to signal that the connection will be closed after<a name="line.45"></a> +<span class="sourceLineNo">046</span> * completion of the response.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * For example...<a name="line.47"></a> +<span class="sourceLineNo">048</span> * <p class='bcode'><a name="line.48"></a> +<span class="sourceLineNo">049</span> * Connection: close<a name="line.49"></a> +<span class="sourceLineNo">050</span> * </p><a name="line.50"></a> +<span class="sourceLineNo">051</span> * <p><a name="line.51"></a> +<span class="sourceLineNo">052</span> * ...in either the request or the response header fields indicates that the connection SHOULD NOT be considered<a name="line.52"></a> +<span class="sourceLineNo">053</span> * `persistent' (section 8.1) after the current request/response is complete.<a name="line.53"></a> +<span class="sourceLineNo">054</span> * <p><a name="line.54"></a> +<span class="sourceLineNo">055</span> * HTTP/1.1 applications that do not support persistent connections MUST include the "close" connection option in<a name="line.55"></a> +<span class="sourceLineNo">056</span> * every message.<a name="line.56"></a> +<span class="sourceLineNo">057</span> * <p><a name="line.57"></a> +<span class="sourceLineNo">058</span> * A system receiving an HTTP/1.0 (or lower-version) message that includes a Connection header MUST, for each<a name="line.58"></a> +<span class="sourceLineNo">059</span> * connection-token in this field, remove and ignore any header field(s) from the message with the same name as the<a name="line.59"></a> +<span class="sourceLineNo">060</span> * connection-token.<a name="line.60"></a> +<span class="sourceLineNo">061</span> * This protects against mistaken forwarding of such header fields by pre-HTTP/1.1 proxies.<a name="line.61"></a> +<span class="sourceLineNo">062</span> * See section 19.6.2.<a name="line.62"></a> +<span class="sourceLineNo">063</span> */<a name="line.63"></a> +<span class="sourceLineNo">064</span>public final class Connection extends HeaderString {<a name="line.64"></a> +<span class="sourceLineNo">065</span><a name="line.65"></a> +<span class="sourceLineNo">066</span> /**<a name="line.66"></a> +<span class="sourceLineNo">067</span> * Returns a parsed <code>Connection</code> header.<a name="line.67"></a> +<span class="sourceLineNo">068</span> *<a name="line.68"></a> +<span class="sourceLineNo">069</span> * @param value The <code>Connection</code> header string.<a name="line.69"></a> +<span class="sourceLineNo">070</span> * @return The parsed <code>Connection</code> header, or <jk>null</jk> if the string was null.<a name="line.70"></a> +<span class="sourceLineNo">071</span> */<a name="line.71"></a> +<span class="sourceLineNo">072</span> public static Connection forString(String value) {<a name="line.72"></a> +<span class="sourceLineNo">073</span> if (value == null)<a name="line.73"></a> +<span class="sourceLineNo">074</span> return null;<a name="line.74"></a> +<span class="sourceLineNo">075</span> return new Connection(value);<a name="line.75"></a> +<span class="sourceLineNo">076</span> }<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> private Connection(String value) {<a name="line.79"></a> +<span class="sourceLineNo">080</span> super(value);<a name="line.80"></a> +<span class="sourceLineNo">081</span> }<a name="line.81"></a> +<span class="sourceLineNo">082</span><a name="line.82"></a> +<span class="sourceLineNo">083</span> /**<a name="line.83"></a> +<span class="sourceLineNo">084</span> * Returns <jk>true</jk> if the header value is <code>close</code>.<a name="line.84"></a> +<span class="sourceLineNo">085</span> * @return <jk>true</jk> if the header value is <code>close</code>.<a name="line.85"></a> +<span class="sourceLineNo">086</span> */<a name="line.86"></a> +<span class="sourceLineNo">087</span> public boolean isClose() {<a name="line.87"></a> +<span class="sourceLineNo">088</span> return eqIC("close");<a name="line.88"></a> +<span class="sourceLineNo">089</span> }<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> * Returns <jk>true</jk> if the header value is <code>keep-alive</code>.<a name="line.92"></a> +<span class="sourceLineNo">093</span> * @return <jk>true</jk> if the header value is <code>keep-alive</code>.<a name="line.93"></a> +<span class="sourceLineNo">094</span> */<a name="line.94"></a> +<span class="sourceLineNo">095</span> public boolean isKeepAlive() {<a name="line.95"></a> +<span class="sourceLineNo">096</span> return eqIC("keep-alive");<a name="line.96"></a> +<span class="sourceLineNo">097</span> }<a name="line.97"></a> +<span class="sourceLineNo">098</span><a name="line.98"></a> +<span class="sourceLineNo">099</span> /**<a name="line.99"></a> +<span class="sourceLineNo">100</span> * Returns <jk>true</jk> if the header value is <code>upgrade</code>.<a name="line.100"></a> +<span class="sourceLineNo">101</span> * @return <jk>true</jk> if the header value is <code>upgrade</code>.<a name="line.101"></a> +<span class="sourceLineNo">102</span> */<a name="line.102"></a> +<span class="sourceLineNo">103</span> public boolean isUpgrade() {<a name="line.103"></a> +<span class="sourceLineNo">104</span> return eqIC("upgrade");<a name="line.104"></a> +<span class="sourceLineNo">105</span> }<a name="line.105"></a> +<span class="sourceLineNo">106</span>}<a name="line.106"></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/Constants.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/Constants.html b/content/site/apidocs/src-html/org/apache/juneau/http/Constants.html new file mode 100644 index 0000000..d9c2dfb --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/Constants.html @@ -0,0 +1,93 @@ +<!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> * Constants used by classes in this package.<a name="line.16"></a> +<span class="sourceLineNo">017</span> */<a name="line.17"></a> +<span class="sourceLineNo">018</span>public class Constants {<a name="line.18"></a> +<span class="sourceLineNo">019</span> static boolean NOCACHE = Boolean.getBoolean("juneau.http.cache.disable");<a name="line.19"></a> +<span class="sourceLineNo">020</span> static int CACHE_MAX_SIZE = Integer.getInteger("juneau.http.cache.maxSize", 1000);<a name="line.20"></a> +<span class="sourceLineNo">021</span>}<a name="line.21"></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/ContentEncoding.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentEncoding.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentEncoding.html new file mode 100644 index 0000000..2dc9b30 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ContentEncoding.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>Content-Encoding</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 type of encoding used on the data.<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> * Content-Encoding: gzip<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 Content-Encoding entity-header field is used as a modifier to the media-type.<a name="line.27"></a> +<span class="sourceLineNo">028</span> * When present, its value indicates what additional content codings have been applied to the entity-body, and thus<a name="line.28"></a> +<span class="sourceLineNo">029</span> * what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type header<a name="line.29"></a> +<span class="sourceLineNo">030</span> * field.<a name="line.30"></a> +<span class="sourceLineNo">031</span> * Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its<a name="line.31"></a> +<span class="sourceLineNo">032</span> * underlying media type.<a name="line.32"></a> +<span class="sourceLineNo">033</span> * <p class='bcode'><a name="line.33"></a> +<span class="sourceLineNo">034</span> * Content-Encoding = "Content-Encoding" ":" 1#content-coding<a name="line.34"></a> +<span class="sourceLineNo">035</span> * </p><a name="line.35"></a> +<span class="sourceLineNo">036</span> * <p><a name="line.36"></a> +<span class="sourceLineNo">037</span> * Content codings are defined in section 3.5. An example of its use is...<a name="line.37"></a> +<span class="sourceLineNo">038</span> * <p class='bcode'><a name="line.38"></a> +<span class="sourceLineNo">039</span> * Content-Encoding: gzip<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> * The content-coding is a characteristic of the entity identified by the Request-URI.<a name="line.42"></a> +<span class="sourceLineNo">043</span> * Typically, the entity-body is stored with this encoding and is only decoded before rendering or analogous usage.<a name="line.43"></a> +<span class="sourceLineNo">044</span> * However, a non-transparent proxy MAY modify the content-coding if the new coding is known to be acceptable to the<a name="line.44"></a> +<span class="sourceLineNo">045</span> * recipient, unless the "no-transform" cache-control directive is present in the message.<a name="line.45"></a> +<span class="sourceLineNo">046</span> * <p><a name="line.46"></a> +<span class="sourceLineNo">047</span> * If the content-coding of an entity is not "identity", then the response MUST include a Content-Encoding<a name="line.47"></a> +<span class="sourceLineNo">048</span> * entity-header (section 14.11) that lists the non-identity content-coding(s) used.<a name="line.48"></a> +<span class="sourceLineNo">049</span> * <p><a name="line.49"></a> +<span class="sourceLineNo">050</span> * If the content-coding of an entity in a request message is not acceptable to the origin server, the server SHOULD<a name="line.50"></a> +<span class="sourceLineNo">051</span> * respond with a status code of 415 (Unsupported Media Type).<a name="line.51"></a> +<span class="sourceLineNo">052</span> * <p><a name="line.52"></a> +<span class="sourceLineNo">053</span> * If multiple encodings have been applied to an entity, the content codings MUST be listed in the order in which they<a name="line.53"></a> +<span class="sourceLineNo">054</span> * were applied.<a name="line.54"></a> +<span class="sourceLineNo">055</span> * Additional information about the encoding parameters MAY be provided.<a name="line.55"></a> +<span class="sourceLineNo">056</span> */<a name="line.56"></a> +<span class="sourceLineNo">057</span>public final class ContentEncoding extends HeaderEnum<ContentEncodingEnum> {<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>Content-Encoding</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>Content-Encoding</code> header string.<a name="line.62"></a> +<span class="sourceLineNo">063</span> * @return The parsed <code>Content-Encoding</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 ContentEncoding 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 ContentEncoding(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 ContentEncoding(String value) {<a name="line.71"></a> +<span class="sourceLineNo">072</span> super(value, ContentEncodingEnum.class, ContentEncodingEnum.OTHER);<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/ContentEncodingEnum.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentEncodingEnum.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentEncodingEnum.html new file mode 100644 index 0000000..be68451 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ContentEncodingEnum.html @@ -0,0 +1,106 @@ +<!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 the possible values for a <code>Content-Encoding</code> header.<a name="line.16"></a> +<span class="sourceLineNo">017</span> */<a name="line.17"></a> +<span class="sourceLineNo">018</span>public enum ContentEncodingEnum {<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span> /** Content-Encoding: gzip */<a name="line.20"></a> +<span class="sourceLineNo">021</span> GZIP,<a name="line.21"></a> +<span class="sourceLineNo">022</span><a name="line.22"></a> +<span class="sourceLineNo">023</span> /** Content-Encoding: compress */<a name="line.23"></a> +<span class="sourceLineNo">024</span> COMPRESS,<a name="line.24"></a> +<span class="sourceLineNo">025</span><a name="line.25"></a> +<span class="sourceLineNo">026</span> /** Content-Encoding: deflate */<a name="line.26"></a> +<span class="sourceLineNo">027</span> DEFLATE,<a name="line.27"></a> +<span class="sourceLineNo">028</span><a name="line.28"></a> +<span class="sourceLineNo">029</span> /** Content-Encoding: identity */<a name="line.29"></a> +<span class="sourceLineNo">030</span> IDENTITY,<a name="line.30"></a> +<span class="sourceLineNo">031</span><a name="line.31"></a> +<span class="sourceLineNo">032</span> /** Unknown value */<a name="line.32"></a> +<span class="sourceLineNo">033</span> OTHER;<a name="line.33"></a> +<span class="sourceLineNo">034</span>}<a name="line.34"></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/ContentLanguage.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentLanguage.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentLanguage.html new file mode 100644 index 0000000..2728f10 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ContentLanguage.html @@ -0,0 +1,150 @@ +<!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>Content-Language</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 natural language or languages of the intended audience for the enclosed content.<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> * Content-Language: da<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 Content-Language entity-header field describes the natural language(s) of the intended audience for the<a name="line.27"></a> +<span class="sourceLineNo">028</span> * enclosed entity.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * Note that this might not be equivalent to all the languages used within the entity-body.<a name="line.29"></a> +<span class="sourceLineNo">030</span> * <p class='bcode'><a name="line.30"></a> +<span class="sourceLineNo">031</span> * Content-Language = "Content-Language" ":" 1#language-tag<a name="line.31"></a> +<span class="sourceLineNo">032</span> * </p><a name="line.32"></a> +<span class="sourceLineNo">033</span> * <p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * Language tags are defined in section 3.10.<a name="line.34"></a> +<span class="sourceLineNo">035</span> * The primary purpose of Content-Language is to allow a user to identify and differentiate entities according to the<a name="line.35"></a> +<span class="sourceLineNo">036</span> * user's own preferred language.<a name="line.36"></a> +<span class="sourceLineNo">037</span> * Thus, if the body content is intended only for a Danish-literate audience, the appropriate field is...<a name="line.37"></a> +<span class="sourceLineNo">038</span> * <p class='bcode'><a name="line.38"></a> +<span class="sourceLineNo">039</span> * Content-Language: da<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> * If no Content-Language is specified, the default is that the content is intended for all language audiences.<a name="line.42"></a> +<span class="sourceLineNo">043</span> * This might mean that the sender does not consider it to be specific to any natural language, or that the sender<a name="line.43"></a> +<span class="sourceLineNo">044</span> * does not know for which language it is intended.<a name="line.44"></a> +<span class="sourceLineNo">045</span> * <p><a name="line.45"></a> +<span class="sourceLineNo">046</span> * Multiple languages MAY be listed for content that is intended for multiple audiences.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * For example, a rendition of the "Treaty of Waitangi," presented simultaneously in the original Maori and English<a name="line.47"></a> +<span class="sourceLineNo">048</span> * versions, would call for...<a name="line.48"></a> +<span class="sourceLineNo">049</span> * <p class='bcode'><a name="line.49"></a> +<span class="sourceLineNo">050</span> * Content-Language: mi, en<a name="line.50"></a> +<span class="sourceLineNo">051</span> * </p><a name="line.51"></a> +<span class="sourceLineNo">052</span> * <p><a name="line.52"></a> +<span class="sourceLineNo">053</span> * However, just because multiple languages are present within an entity does not mean that it is intended for<a name="line.53"></a> +<span class="sourceLineNo">054</span> * multiple linguistic audiences.<a name="line.54"></a> +<span class="sourceLineNo">055</span> * An example would be a beginner's language primer, such as "A First Lesson in Latin," which is clearly intended to<a name="line.55"></a> +<span class="sourceLineNo">056</span> * be used by an English-literate audience.<a name="line.56"></a> +<span class="sourceLineNo">057</span> * In this case, the Content-Language would properly only include "en".<a name="line.57"></a> +<span class="sourceLineNo">058</span> * <p><a name="line.58"></a> +<span class="sourceLineNo">059</span> * Content-Language MAY be applied to any media type -- it is not limited to textual documents.<a name="line.59"></a> +<span class="sourceLineNo">060</span> */<a name="line.60"></a> +<span class="sourceLineNo">061</span>public final class ContentLanguage extends HeaderStringArray {<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> * Returns a parsed <code>Content-Language</code> header.<a name="line.64"></a> +<span class="sourceLineNo">065</span> *<a name="line.65"></a> +<span class="sourceLineNo">066</span> * @param value The <code>Content-Language</code> header string.<a name="line.66"></a> +<span class="sourceLineNo">067</span> * @return The parsed <code>Content-Language</code> header, or <jk>null</jk> if the string was null.<a name="line.67"></a> +<span class="sourceLineNo">068</span> */<a name="line.68"></a> +<span class="sourceLineNo">069</span> public static ContentLanguage forString(String value) {<a name="line.69"></a> +<span class="sourceLineNo">070</span> if (value == null)<a name="line.70"></a> +<span class="sourceLineNo">071</span> return null;<a name="line.71"></a> +<span class="sourceLineNo">072</span> return new ContentLanguage(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> +<span class="sourceLineNo">075</span> private ContentLanguage(String value) {<a name="line.75"></a> +<span class="sourceLineNo">076</span> super(value);<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> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</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/ContentLength.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentLength.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentLength.html new file mode 100644 index 0000000..2ae0176 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ContentLength.html @@ -0,0 +1,139 @@ +<!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>Content-Length</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> * The length of the response body in octets (8-bit bytes).<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> * Content-Length: 348<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 Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to<a name="line.27"></a> +<span class="sourceLineNo">028</span> * the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the<a name="line.28"></a> +<span class="sourceLineNo">029</span> * request been a GET.<a name="line.29"></a> +<span class="sourceLineNo">030</span> * <p class='bcode'><a name="line.30"></a> +<span class="sourceLineNo">031</span> * Content-Length = "Content-Length" ":" 1*DIGIT<a name="line.31"></a> +<span class="sourceLineNo">032</span> * </p><a name="line.32"></a> +<span class="sourceLineNo">033</span> * <p><a name="line.33"></a> +<span class="sourceLineNo">034</span> * An example is...<a name="line.34"></a> +<span class="sourceLineNo">035</span> * <p class='bcode'><a name="line.35"></a> +<span class="sourceLineNo">036</span> * Content-Length: 3495<a name="line.36"></a> +<span class="sourceLineNo">037</span> * </p><a name="line.37"></a> +<span class="sourceLineNo">038</span> * <p><a name="line.38"></a> +<span class="sourceLineNo">039</span> * Applications SHOULD use this field to indicate the transfer-length of the message-body, unless this is prohibited by<a name="line.39"></a> +<span class="sourceLineNo">040</span> * the rules in section 4.4.<a name="line.40"></a> +<span class="sourceLineNo">041</span> * <p><a name="line.41"></a> +<span class="sourceLineNo">042</span> * Any Content-Length greater than or equal to zero is a valid value.<a name="line.42"></a> +<span class="sourceLineNo">043</span> * Section 4.4 describes how to determine the length of a message-body if a Content-Length is not given.<a name="line.43"></a> +<span class="sourceLineNo">044</span> * <p><a name="line.44"></a> +<span class="sourceLineNo">045</span> * Note that the meaning of this field is significantly different from the corresponding definition in MIME, where it is<a name="line.45"></a> +<span class="sourceLineNo">046</span> * an optional field used within the "message/external-body" content-type.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * In HTTP, it SHOULD be sent whenever the message's length can be determined prior to being transferred, unless this is<a name="line.47"></a> +<span class="sourceLineNo">048</span> * prohibited by the rules in section 4.4.<a name="line.48"></a> +<span class="sourceLineNo">049</span> */<a name="line.49"></a> +<span class="sourceLineNo">050</span>public final class ContentLength extends HeaderInteger {<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>Content-Length</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>Content-Length</code> header string.<a name="line.55"></a> +<span class="sourceLineNo">056</span> * @return The parsed <code>Content-Length</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 ContentLength 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 ContentLength(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 ContentLength(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> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</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/ContentLocation.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentLocation.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentLocation.html new file mode 100644 index 0000000..8a54670 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ContentLocation.html @@ -0,0 +1,144 @@ +<!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>Content-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> * An alternate location for the returned data.<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> * Content-Location: /index.htm<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 Content-Location entity-header field MAY be used to supply the resource location for the entity enclosed in the<a name="line.27"></a> +<span class="sourceLineNo">028</span> * message when that entity is accessible from a location separate from the requested resource's URI.<a name="line.28"></a> +<span class="sourceLineNo">029</span> * A server SHOULD provide a Content-Location for the variant corresponding to the response entity; especially in the<a name="line.29"></a> +<span class="sourceLineNo">030</span> * case where a resource has multiple entities associated with it, and those entities actually have separate locations<a name="line.30"></a> +<span class="sourceLineNo">031</span> * by which they might be individually accessed, the server SHOULD provide a Content-Location for the particular variant<a name="line.31"></a> +<span class="sourceLineNo">032</span> * which is returned.<a name="line.32"></a> +<span class="sourceLineNo">033</span> * <p class='bcode'><a name="line.33"></a> +<span class="sourceLineNo">034</span> * Content-Location = "Content-Location" ":"<a name="line.34"></a> +<span class="sourceLineNo">035</span> * ( absoluteURI | relativeURI )<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 value of Content-Location also defines the base URI for the entity.<a name="line.38"></a> +<span class="sourceLineNo">039</span> * <p><a name="line.39"></a> +<span class="sourceLineNo">040</span> * The Content-Location value is not a replacement for the original requested URI; it is only a statement of the<a name="line.40"></a> +<span class="sourceLineNo">041</span> * location of the resource corresponding to this particular entity at the time of the request.<a name="line.41"></a> +<span class="sourceLineNo">042</span> * Future requests MAY specify the Content-Location URI as the request- URI if the desire is to identify the source of<a name="line.42"></a> +<span class="sourceLineNo">043</span> * that particular entity.<a name="line.43"></a> +<span class="sourceLineNo">044</span> * <p><a name="line.44"></a> +<span class="sourceLineNo">045</span> * A cache cannot assume that an entity with a Content-Location different from the URI used to retrieve it can be used<a name="line.45"></a> +<span class="sourceLineNo">046</span> * to respond to later requests on that Content-Location URI.<a name="line.46"></a> +<span class="sourceLineNo">047</span> * However, the Content- Location can be used to differentiate between multiple entities retrieved from a single<a name="line.47"></a> +<span class="sourceLineNo">048</span> * requested resource, as described in section 13.6.<a name="line.48"></a> +<span class="sourceLineNo">049</span> * <p><a name="line.49"></a> +<span class="sourceLineNo">050</span> * If the Content-Location is a relative URI, the relative URI is interpreted relative to the Request-URI.<a name="line.50"></a> +<span class="sourceLineNo">051</span> * <p><a name="line.51"></a> +<span class="sourceLineNo">052</span> * The meaning of the Content-Location header in PUT or POST requests is undefined; servers are free to ignore it in<a name="line.52"></a> +<span class="sourceLineNo">053</span> * those cases.<a name="line.53"></a> +<span class="sourceLineNo">054</span> */<a name="line.54"></a> +<span class="sourceLineNo">055</span>public final class ContentLocation extends HeaderUri {<a name="line.55"></a> +<span class="sourceLineNo">056</span><a name="line.56"></a> +<span class="sourceLineNo">057</span> /**<a name="line.57"></a> +<span class="sourceLineNo">058</span> * Returns a parsed <code>Content-Location</code> header.<a name="line.58"></a> +<span class="sourceLineNo">059</span> *<a name="line.59"></a> +<span class="sourceLineNo">060</span> * @param value The <code>Content-Location</code> header string.<a name="line.60"></a> +<span class="sourceLineNo">061</span> * @return The parsed <code>Content-Location</code> header, or <jk>null</jk> if the string was null.<a name="line.61"></a> +<span class="sourceLineNo">062</span> */<a name="line.62"></a> +<span class="sourceLineNo">063</span> public static ContentLocation forString(String value) {<a name="line.63"></a> +<span class="sourceLineNo">064</span> if (value == null)<a name="line.64"></a> +<span class="sourceLineNo">065</span> return null;<a name="line.65"></a> +<span class="sourceLineNo">066</span> return new ContentLocation(value);<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> private ContentLocation(String value) {<a name="line.69"></a> +<span class="sourceLineNo">070</span> super(value);<a name="line.70"></a> +<span class="sourceLineNo">071</span> }<a name="line.71"></a> +<span class="sourceLineNo">072</span>}<a name="line.72"></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/ContentMD5.html ---------------------------------------------------------------------- diff --git a/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html b/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html new file mode 100644 index 0000000..76fa567 --- /dev/null +++ b/content/site/apidocs/src-html/org/apache/juneau/http/ContentMD5.html @@ -0,0 +1,160 @@ +<!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 java.util.concurrent.*;<a name="line.15"></a> +<span class="sourceLineNo">016</span><a name="line.16"></a> +<span class="sourceLineNo">017</span>/**<a name="line.17"></a> +<span class="sourceLineNo">018</span> * Represents a parsed <code>XXX:</code> HTTP header.<a name="line.18"></a> +<span class="sourceLineNo">019</span> * <p><a name="line.19"></a> +<span class="sourceLineNo">020</span> * <h6 class='topic>RFC2616 Specification</h6><a name="line.20"></a> +<span class="sourceLineNo">021</span> * <p class='bcode'><a name="line.21"></a> +<span class="sourceLineNo">022</span>The Content-MD5 entity-header field, as defined in RFC 1864 [23], is an MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) of the entity-body. (Note: a MIC is good for detecting accidental modification of the entity-body in transit, but is not proof against malicious attacks.)<a name="line.22"></a> +<span class="sourceLineNo">023</span><a name="line.23"></a> +<span class="sourceLineNo">024</span> Content-MD5 = "Content-MD5" ":" md5-digest<a name="line.24"></a> +<span class="sourceLineNo">025</span> md5-digest = <base64 of 128 bit MD5 digest as per RFC 1864><a name="line.25"></a> +<span class="sourceLineNo">026</span>The Content-MD5 header field MAY be generated by an origin server or client to function as an integrity check of the entity-body. Only origin servers or clients MAY generate the Content-MD5 header field; proxies and gateways MUST NOT generate it, as this would defeat its value as an end-to-end integrity check. Any recipient of the entity- body, including gateways and proxies, MAY check that the digest value in this header field matches that of the entity-body as received.<a name="line.26"></a> +<span class="sourceLineNo">027</span><a name="line.27"></a> +<span class="sourceLineNo">028</span>The MD5 digest is computed based on the content of the entity-body, including any content-coding that has been applied, but not including any transfer-encoding applied to the message-body. If the message is received with a transfer-encoding, that encoding MUST be removed prior to checking the Content-MD5 value against the received entity.<a name="line.28"></a> +<span class="sourceLineNo">029</span><a name="line.29"></a> +<span class="sourceLineNo">030</span>This has the result that the digest is computed on the octets of the entity-body exactly as, and in the order that, they would be sent if no transfer-encoding were being applied.<a name="line.30"></a> +<span class="sourceLineNo">031</span><a name="line.31"></a> +<span class="sourceLineNo">032</span>HTTP extends RFC 1864 to permit the digest to be computed for MIME composite media-types (e.g., multipart/* and message/rfc822), but this does not change how the digest is computed as defined in the preceding paragraph.<a name="line.32"></a> +<span class="sourceLineNo">033</span><a name="line.33"></a> +<span class="sourceLineNo">034</span>There are several consequences of this. The entity-body for composite types MAY contain many body-parts, each with its own MIME and HTTP headers (including Content-MD5, Content-Transfer-Encoding, and Content-Encoding headers). If a body-part has a Content-Transfer- Encoding or Content-Encoding header, it is assumed that the content of the body-part has had the encoding applied, and the body-part is included in the Content-MD5 digest as is -- i.e., after the application. The Transfer-Encoding header field is not allowed within body-parts.<a name="line.34"></a> +<span class="sourceLineNo">035</span><a name="line.35"></a> +<span class="sourceLineNo">036</span>Conversion of all line breaks to CRLF MUST NOT be done before computing or checking the digest: the line break convention used in the text actually transmitted MUST be left unaltered when computing the digest.<a name="line.36"></a> +<span class="sourceLineNo">037</span><a name="line.37"></a> +<span class="sourceLineNo">038</span> Note: while the definition of Content-MD5 is exactly the same for<a name="line.38"></a> +<span class="sourceLineNo">039</span> HTTP as in RFC 1864 for MIME entity-bodies, there are several ways<a name="line.39"></a> +<span class="sourceLineNo">040</span> in which the application of Content-MD5 to HTTP entity-bodies<a name="line.40"></a> +<span class="sourceLineNo">041</span> differs from its application to MIME entity-bodies. One is that<a name="line.41"></a> +<span class="sourceLineNo">042</span> HTTP, unlike MIME, does not use Content-Transfer-Encoding, and<a name="line.42"></a> +<span class="sourceLineNo">043</span> does use Transfer-Encoding and Content-Encoding. Another is that<a name="line.43"></a> +<span class="sourceLineNo">044</span> HTTP more frequently uses binary content types than MIME, so it is<a name="line.44"></a> +<span class="sourceLineNo">045</span> worth noting that, in such cases, the byte order used to compute<a name="line.45"></a> +<span class="sourceLineNo">046</span> the digest is the transmission byte order defined for the type.<a name="line.46"></a> +<span class="sourceLineNo">047</span> Lastly, HTTP allows transmission of text types with any of several<a name="line.47"></a> +<span class="sourceLineNo">048</span> line break conventions and not just the canonical form using CRLF.<a name="line.48"></a> +<span class="sourceLineNo">049</span> * </p><a name="line.49"></a> +<span class="sourceLineNo">050</span> */<a name="line.50"></a> +<span class="sourceLineNo">051</span>public final class ContentMD5 {<a name="line.51"></a> +<span class="sourceLineNo">052</span><a name="line.52"></a> +<span class="sourceLineNo">053</span> private static final boolean nocache = Boolean.getBoolean("juneau.http.Accept.nocache");<a name="line.53"></a> +<span class="sourceLineNo">054</span> private static final ConcurrentHashMap<String,ContentMD5> cache = new ConcurrentHashMap<String,ContentMD5>();<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>Accept</code> header.<a name="line.57"></a> +<span class="sourceLineNo">058</span> *<a name="line.58"></a> +<span class="sourceLineNo">059</span> * @param s The <code>Accept</code> header string.<a name="line.59"></a> +<span class="sourceLineNo">060</span> * @return The parsed <code>Accept</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 ContentMD5 forString(String s) {<a name="line.62"></a> +<span class="sourceLineNo">063</span> if (s == null)<a name="line.63"></a> +<span class="sourceLineNo">064</span> return null;<a name="line.64"></a> +<span class="sourceLineNo">065</span><a name="line.65"></a> +<span class="sourceLineNo">066</span> // Prevent OOM in case of DDOS<a name="line.66"></a> +<span class="sourceLineNo">067</span> if (cache.size() > 1000)<a name="line.67"></a> +<span class="sourceLineNo">068</span> cache.clear();<a name="line.68"></a> +<span class="sourceLineNo">069</span><a name="line.69"></a> +<span class="sourceLineNo">070</span> while (true) {<a name="line.70"></a> +<span class="sourceLineNo">071</span> ContentMD5 a = cache.get(s);<a name="line.71"></a> +<span class="sourceLineNo">072</span> if (a != null)<a name="line.72"></a> +<span class="sourceLineNo">073</span> return a;<a name="line.73"></a> +<span class="sourceLineNo">074</span> a = new ContentMD5(s);<a name="line.74"></a> +<span class="sourceLineNo">075</span> if (nocache)<a name="line.75"></a> +<span class="sourceLineNo">076</span> return a;<a name="line.76"></a> +<span class="sourceLineNo">077</span> cache.putIfAbsent(s, a);<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><a name="line.80"></a> +<span class="sourceLineNo">081</span> private ContentMD5(String raw) {<a name="line.81"></a> +<span class="sourceLineNo">082</span> }<a name="line.82"></a> +<span class="sourceLineNo">083</span><a name="line.83"></a> +<span class="sourceLineNo">084</span> @Override /* Object */<a name="line.84"></a> +<span class="sourceLineNo">085</span> public String toString() {<a name="line.85"></a> +<span class="sourceLineNo">086</span> return null;<a name="line.86"></a> +<span class="sourceLineNo">087</span> }<a name="line.87"></a> +<span class="sourceLineNo">088</span>}<a name="line.88"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html>
