Moved code to org.apache.hc.client5 namespace
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1724949 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4cd379311
commit
dc86ba043d
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.examples.client.fluent;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
|
@ -33,6 +33,9 @@ import java.util.concurrent.ExecutorService;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.apache.hc.client5.http.client.fluent.Async;
|
||||
import org.apache.hc.client5.http.client.fluent.Content;
|
||||
import org.apache.hc.client5.http.client.fluent.Request;
|
||||
import org.apache.hc.core5.concurrent.FutureCallback;
|
||||
|
||||
/**
|
|
@ -24,10 +24,13 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.examples.client.fluent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.hc.client5.http.client.fluent.Executor;
|
||||
import org.apache.hc.client5.http.client.fluent.Form;
|
||||
import org.apache.hc.client5.http.client.fluent.Request;
|
||||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.entity.ContentType;
|
|
@ -24,7 +24,10 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.examples.client.fluent;
|
||||
|
||||
import org.apache.hc.client5.http.client.fluent.Form;
|
||||
import org.apache.hc.client5.http.client.fluent.Request;
|
||||
|
||||
public class FluentQuickStart {
|
||||
|
|
@ -24,10 +24,12 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.examples.client.fluent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.hc.client5.http.client.fluent.Form;
|
||||
import org.apache.hc.client5.http.client.fluent.Request;
|
||||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.entity.ContentType;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.examples.client.fluent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -34,13 +34,14 @@ import javax.xml.parsers.DocumentBuilder;
|
|||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.apache.hc.client5.http.client.fluent.Request;
|
||||
import org.apache.hc.core5.http.HttpEntity;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.hc.core5.http.StatusLine;
|
||||
import org.apache.hc.core5.http.entity.ContentType;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.HttpResponseException;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.hc.client5.http.client.ClientProtocolException;
|
||||
import org.apache.hc.client5.http.client.HttpResponseException;
|
||||
import org.apache.hc.client5.http.client.ResponseHandler;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
|
|
@ -24,13 +24,13 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import org.apache.hc.core5.concurrent.BasicFuture;
|
||||
import org.apache.hc.core5.concurrent.FutureCallback;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.hc.client5.http.client.ResponseHandler;
|
||||
|
||||
public class Async {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
|
@ -24,21 +24,21 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.hc.core5.http.HttpEntity;
|
||||
import org.apache.hc.core5.http.entity.ContentType;
|
||||
import org.apache.hc.core5.http.entity.EntityUtils;
|
||||
import org.apache.http.impl.client.AbstractResponseHandler;
|
||||
import org.apache.hc.client5.http.impl.client.AbstractResponseHandler;
|
||||
|
||||
/**
|
||||
* {@link org.apache.http.client.ResponseHandler} implementation that converts
|
||||
* {@link org.apache.hc.core5.http.HttpResponse} messages to {@link org.apache.http.client.fluent.Content}
|
||||
* {@link org.apache.hc.client5.http.client.ResponseHandler} implementation that converts
|
||||
* {@link org.apache.hc.core5.http.HttpResponse} messages to {@link org.apache.hc.client5.http.client.fluent.Content}
|
||||
* instances.
|
||||
*
|
||||
* @see org.apache.http.client.fluent.Content
|
||||
* @see org.apache.hc.client5.http.client.fluent.Content
|
||||
*
|
||||
* @since 4.4
|
||||
*/
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyManagementException;
|
||||
|
@ -36,25 +36,25 @@ import javax.net.ssl.SSLContext;
|
|||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.config.Registry;
|
||||
import org.apache.hc.core5.http.config.RegistryBuilder;
|
||||
import org.apache.http.auth.AuthScope;
|
||||
import org.apache.http.auth.Credentials;
|
||||
import org.apache.http.auth.NTCredentials;
|
||||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.AuthCache;
|
||||
import org.apache.http.client.CookieStore;
|
||||
import org.apache.http.client.CredentialsStore;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.LayeredConnectionSocketFactory;
|
||||
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.SSLInitializationException;
|
||||
import org.apache.http.impl.auth.BasicScheme;
|
||||
import org.apache.http.impl.client.BasicAuthCache;
|
||||
import org.apache.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.hc.client5.http.auth.AuthScope;
|
||||
import org.apache.hc.client5.http.auth.Credentials;
|
||||
import org.apache.hc.client5.http.auth.NTCredentials;
|
||||
import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.hc.client5.http.client.AuthCache;
|
||||
import org.apache.hc.client5.http.client.CookieStore;
|
||||
import org.apache.hc.client5.http.client.CredentialsStore;
|
||||
import org.apache.hc.client5.http.client.HttpClient;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.conn.socket.ConnectionSocketFactory;
|
||||
import org.apache.hc.client5.http.conn.socket.LayeredConnectionSocketFactory;
|
||||
import org.apache.hc.client5.http.conn.socket.PlainConnectionSocketFactory;
|
||||
import org.apache.hc.client5.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.hc.client5.http.conn.ssl.SSLInitializationException;
|
||||
import org.apache.hc.client5.http.impl.auth.BasicScheme;
|
||||
import org.apache.hc.client5.http.impl.client.BasicAuthCache;
|
||||
import org.apache.hc.client5.http.impl.client.BasicCredentialsProvider;
|
||||
import org.apache.hc.client5.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.hc.client5.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
|
||||
/**
|
||||
* An Executor for fluent requests.
|
||||
|
@ -233,7 +233,7 @@ public class Executor {
|
|||
* or discarded using {@link Response#discardContent()}, otherwise the
|
||||
* connection used for the request might not be released to the pool.
|
||||
*
|
||||
* @see Response#handleResponse(org.apache.http.client.ResponseHandler)
|
||||
* @see Response#handleResponse(org.apache.hc.client5.http.client.ResponseHandler)
|
||||
* @see Response#discardContent()
|
||||
*/
|
||||
public Response execute(
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
class HttpHeader {
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
@ -39,10 +39,10 @@ import org.apache.hc.core5.http.RequestLine;
|
|||
import org.apache.hc.core5.http.message.AbstractHttpMessage;
|
||||
import org.apache.hc.core5.http.message.BasicRequestLine;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.Configurable;
|
||||
import org.apache.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.apache.hc.client5.http.client.config.RequestConfig;
|
||||
import org.apache.hc.client5.http.client.methods.Configurable;
|
||||
import org.apache.hc.client5.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.hc.client5.http.client.methods.HttpUriRequest;
|
||||
|
||||
@NotThreadSafe
|
||||
class InternalHttpRequest extends AbstractHttpMessage
|
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -49,18 +49,18 @@ import org.apache.hc.core5.http.HttpVersion;
|
|||
import org.apache.hc.core5.http.NameValuePair;
|
||||
import org.apache.hc.core5.http.entity.ContentType;
|
||||
import org.apache.hc.core5.http.protocol.HttpContext;
|
||||
import org.apache.http.client.HttpClient;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.methods.Configurable;
|
||||
import org.apache.http.client.methods.HttpDelete;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpHead;
|
||||
import org.apache.http.client.methods.HttpOptions;
|
||||
import org.apache.http.client.methods.HttpPatch;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.client.methods.HttpPut;
|
||||
import org.apache.http.client.methods.HttpTrace;
|
||||
import org.apache.http.client.utils.URLEncodedUtils;
|
||||
import org.apache.hc.client5.http.client.HttpClient;
|
||||
import org.apache.hc.client5.http.client.config.RequestConfig;
|
||||
import org.apache.hc.client5.http.client.methods.Configurable;
|
||||
import org.apache.hc.client5.http.client.methods.HttpDelete;
|
||||
import org.apache.hc.client5.http.client.methods.HttpGet;
|
||||
import org.apache.hc.client5.http.client.methods.HttpHead;
|
||||
import org.apache.hc.client5.http.client.methods.HttpOptions;
|
||||
import org.apache.hc.client5.http.client.methods.HttpPatch;
|
||||
import org.apache.hc.client5.http.client.methods.HttpPost;
|
||||
import org.apache.hc.client5.http.client.methods.HttpPut;
|
||||
import org.apache.hc.client5.http.client.methods.HttpTrace;
|
||||
import org.apache.hc.client5.http.client.utils.URLEncodedUtils;
|
||||
|
||||
public class Request {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -37,8 +37,8 @@ import org.apache.hc.core5.http.StatusLine;
|
|||
import org.apache.hc.core5.http.entity.ByteArrayEntity;
|
||||
import org.apache.hc.core5.http.entity.ContentType;
|
||||
import org.apache.hc.core5.http.entity.EntityUtils;
|
||||
import org.apache.http.client.HttpResponseException;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.hc.client5.http.client.HttpResponseException;
|
||||
import org.apache.hc.client5.http.client.ResponseHandler;
|
||||
|
||||
public class Response {
|
||||
|
|
@ -29,4 +29,4 @@
|
|||
* Simple facade APIs for HttpClient based on the concept of
|
||||
* a fluent interface.
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.fluent;
|
||||
package org.apache.hc.client5.http.client.fluent;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -41,9 +41,9 @@ import org.apache.hc.core5.http.entity.EntityUtils;
|
|||
import org.apache.hc.core5.http.entity.StringEntity;
|
||||
import org.apache.hc.core5.http.io.HttpRequestHandler;
|
||||
import org.apache.hc.core5.http.protocol.HttpContext;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.ResponseHandler;
|
||||
import org.apache.http.localserver.LocalServerTestBase;
|
||||
import org.apache.hc.client5.http.client.ClientProtocolException;
|
||||
import org.apache.hc.client5.http.client.ResponseHandler;
|
||||
import org.apache.hc.client5.http.localserver.LocalServerTestBase;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
|
@ -24,15 +24,15 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
/**
|
||||
* This enumeration represents the various ways a response can be generated
|
||||
* by the {@link org.apache.http.impl.client.cache.CachingHttpClient};
|
||||
* if a request is executed with an {@link org.apache.http.protocol.HttpContext}
|
||||
* by the {@link org.apache.hc.client5.http.impl.client.cache.CachingHttpClient};
|
||||
* if a request is executed with an {@link org.apache.hc.client5.http.protocol.HttpContext}
|
||||
* then a parameter with one of these values will be registered in the
|
||||
* context under the key
|
||||
* {@link org.apache.http.impl.client.cache.CachingHttpClient#CACHE_RESPONSE_STATUS}.
|
||||
* {@link org.apache.hc.client5.http.impl.client.cache.CachingHttpClient#CACHE_RESPONSE_STATUS}.
|
||||
*/
|
||||
public enum CacheResponseStatus {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
|
|
@ -24,12 +24,12 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import org.apache.hc.core5.annotation.NotThreadSafe;
|
||||
import org.apache.hc.core5.http.protocol.BasicHttpContext;
|
||||
import org.apache.hc.core5.http.protocol.HttpContext;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
|
||||
/**
|
||||
* @since 4.3
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
|
@ -40,7 +40,7 @@ import org.apache.hc.core5.http.ProtocolVersion;
|
|||
import org.apache.hc.core5.http.StatusLine;
|
||||
import org.apache.hc.core5.http.message.HeaderGroup;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* Structure used to store an {@link org.apache.hc.core5.http.HttpResponse} in a cache.
|
||||
|
@ -310,7 +310,7 @@ public class HttpCacheEntry implements Serializable {
|
|||
* a given resource are stored. This maps "variant keys" to "cache keys",
|
||||
* where the variant key is derived from the varying request headers,
|
||||
* and the cache key is the location in the
|
||||
* {@link org.apache.http.client.cache.HttpCacheStorage} where that
|
||||
* {@link org.apache.hc.client5.http.client.cache.HttpCacheStorage} where that
|
||||
* particular variant is stored. The first variant returned is used as
|
||||
* the "parent" entry to hold this index of the other variants.
|
||||
*/
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpRequest;
|
|
@ -24,14 +24,14 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* New storage backends should implement this {@link HttpCacheStorage}
|
||||
* interface. They can then be plugged into the existing
|
||||
* {@link org.apache.http.impl.client.cache.CachingHttpClient}
|
||||
* {@link org.apache.hc.client5.http.impl.client.cache.CachingHttpClient}
|
||||
* implementation.
|
||||
*
|
||||
* @since 4.1
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
/**
|
||||
* Signals that {@link HttpCacheStorage} encountered an error performing an
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import org.apache.hc.core5.annotation.NotThreadSafe;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
78
httpclient-cache/src/main/java/org/apache/hc/client5/http/client/cache/package.html
vendored
Normal file
78
httpclient-cache/src/main/java/org/apache/hc/client5/http/client/cache/package.html
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
====================================================================
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
====================================================================
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals on behalf of the Apache Software Foundation. For more
|
||||
information on the Apache Software Foundation, please see
|
||||
<http://www.apache.org/>.
|
||||
-->
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
<p>
|
||||
This package consists largely of constants and interfaces that are
|
||||
necessary for building new storage backends for the
|
||||
{@link org.apache.hc.client5.http.impl.client.cache.CachingHttpClient} or for
|
||||
those clients wanting to get a little more behavioral information
|
||||
out of the cache module (for example, whether a particular response
|
||||
was a cache hit or not). Developers that simply want to instantiate
|
||||
and make use of the caching module will be better off looking at
|
||||
the {@code CachingHttpClient} documentation itself.
|
||||
</p>
|
||||
<p>
|
||||
The classes in this package can be divided into two main groups:
|
||||
reference constants and interfaces needed for storage backends. In
|
||||
the former group,
|
||||
{@link org.apache.hc.client5.http.client.cache.HeaderConstants} contains a list
|
||||
of HTTP header names encoded as static fields, and the
|
||||
{@link org.apache.hc.client5.http.client.cache.CacheResponseStatus} enumeration
|
||||
values are set in an {@link org.apache.hc.client5.http.protocol.HttpContext} by
|
||||
the {@code CachingHttpClient} to indicate how the request was
|
||||
processed by the caching module itself.
|
||||
</p>
|
||||
<p>
|
||||
New storage backends will need to implement the
|
||||
{@link org.apache.hc.client5.http.client.cache.HttpCacheStorage}
|
||||
interface; they can then be passed to one of the {@code CachingHttpClient}
|
||||
constructors, which will happily make use of the new storage mechanism.
|
||||
The {@link org.apache.hc.client5.http.client.cache.HttpCacheEntry} class shows the
|
||||
datastructure for a cache entry that must be stored by the
|
||||
{@code HttpCacheStorage}.
|
||||
There is, in addition, the notion of a
|
||||
{@link org.apache.hc.client5.http.client.cache.Resource} and an associated
|
||||
{@link org.apache.hc.client5.http.client.cache.ResourceFactory}, which are used for
|
||||
managing the handling of cached response bodies. The default implementation
|
||||
used by the {@code CachingHttpClient} stores response bodies in memory;
|
||||
alternative implementations might involve storing these in a filesystem. A new
|
||||
{@code ResourceFactory} can be provided along with a {@code HttpCacheStorage}
|
||||
in one of the constructors to the {@code CachingHttpClient}. Finally, some
|
||||
of the additional storage backends we provide, like the
|
||||
{@link org.apache.hc.client5.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage} and
|
||||
{@link org.apache.hc.client5.http.impl.client.cache.memcached.MemcachedHttpCacheStorage},
|
||||
can be provided with different serializers for the cache entry metadata;
|
||||
developers wanting to experiment with different serialization techniques
|
||||
should implement the
|
||||
{@link org.apache.hc.client5.http.client.cache.HttpCacheEntrySerializer} interface.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -33,13 +33,13 @@ import org.apache.commons.logging.LogFactory;
|
|||
import org.apache.hc.core5.http.Header;
|
||||
import org.apache.hc.core5.http.HttpException;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.conn.routing.HttpRoute;
|
||||
|
||||
/**
|
||||
* Class used to represent an asynchronous revalidation event, such as with
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
@ -35,11 +35,11 @@ import java.util.concurrent.RejectedExecutionException;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.conn.routing.HttpRoute;
|
||||
|
||||
/**
|
||||
* Class used for asynchronous revalidations to be used when the "stale-
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
@ -45,16 +45,16 @@ import org.apache.hc.core5.http.HttpStatus;
|
|||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.entity.ByteArrayEntity;
|
||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheInvalidator;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateException;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheInvalidator;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateException;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
|
||||
class BasicHttpCache implements HttpCache {
|
||||
private static final Set<String> safeRequestMethods = new HashSet<>(
|
|
@ -24,14 +24,14 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.hc.core5.annotation.ThreadSafe;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateCallback;
|
||||
|
||||
/**
|
||||
* Basic {@link HttpCacheStorage} implementation backed by an instance of
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
|
@ -24,12 +24,12 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import org.apache.hc.core5.util.Args;
|
||||
|
||||
/**
|
||||
* <p>Java Beans-style configuration for caching {@link org.apache.http.client.HttpClient}.
|
||||
* <p>Java Beans-style configuration for caching {@link org.apache.hc.client5.http.client.HttpClient}.
|
||||
* Any class in the caching module that has configuration options should take a
|
||||
* {@link CacheConfig} argument in one of its constructors. A
|
||||
* {@code CacheConfig} instance has sane and conservative defaults, so the
|
||||
|
@ -38,7 +38,7 @@ import org.apache.hc.core5.util.Args;
|
|||
*
|
||||
* <p><b>N.B.</b> This class is only for caching-specific configuration; to
|
||||
* configure the behavior of the rest of the client, configure the
|
||||
* {@link org.apache.http.client.HttpClient} used as the "backend"
|
||||
* {@link org.apache.hc.client5.http.client.HttpClient} used as the "backend"
|
||||
* for the {@code CachingHttpClient}.</p>
|
||||
*
|
||||
* <p>Cache configuration can be grouped into the following categories:</p>
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -38,7 +38,7 @@ import org.apache.hc.core5.http.HttpEntity;
|
|||
import org.apache.hc.core5.http.HttpHeaders;
|
||||
import org.apache.hc.core5.http.TrailerSupplier;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
@Immutable
|
||||
class CacheEntity implements HttpEntity, Serializable {
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -39,11 +39,11 @@ import org.apache.hc.core5.http.HttpHeaders;
|
|||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.hc.core5.http.HttpStatus;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* Update a {@link HttpCacheEntry} with new or updated information based on the latest
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
|
@ -39,11 +39,11 @@ import org.apache.hc.core5.http.HttpHeaders;
|
|||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheInvalidator;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheInvalidator;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* Given a particular HttpRequest, flush any cache entries that this request
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.MalformedURLException;
|
||||
|
@ -41,9 +41,9 @@ import org.apache.hc.core5.http.Header;
|
|||
import org.apache.hc.core5.http.HeaderElement;
|
||||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.utils.URIUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.utils.URIUtils;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,12 +24,12 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
final class CacheMap extends LinkedHashMap<String, HttpCacheEntry> {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -33,9 +33,9 @@ import org.apache.hc.core5.http.Header;
|
|||
import org.apache.hc.core5.http.HeaderElement;
|
||||
import org.apache.hc.core5.http.HttpHeaders;
|
||||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
@ -34,7 +34,7 @@ import org.apache.hc.core5.http.HeaderElement;
|
|||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.ProtocolVersion;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
|
||||
/**
|
||||
* Determines if an HttpRequest is allowed to be served from the cache.
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -37,11 +37,11 @@ import org.apache.hc.core5.http.HttpStatus;
|
|||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* Rebuilds an {@link HttpResponse} from a {@link net.sf.ehcache.CacheEntry}
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -36,9 +36,9 @@ import org.apache.hc.core5.http.HeaderElement;
|
|||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.hc.core5.http.HttpStatus;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* Determines whether a given {@link HttpCacheEntry} is suitable to be
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
@ -37,6 +37,20 @@ import java.util.concurrent.atomic.AtomicLong;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.hc.client5.http.client.cache.CacheResponseStatus;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheContext;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.utils.URIUtils;
|
||||
import org.apache.hc.client5.http.conn.routing.HttpRoute;
|
||||
import org.apache.hc.client5.http.impl.execchain.ClientExecChain;
|
||||
import org.apache.hc.core5.annotation.ThreadSafe;
|
||||
import org.apache.hc.core5.http.Header;
|
||||
import org.apache.hc.core5.http.HeaderElement;
|
||||
|
@ -56,20 +70,6 @@ import org.apache.hc.core5.http.protocol.HttpContext;
|
|||
import org.apache.hc.core5.http.protocol.HttpCoreContext;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.hc.core5.util.VersionInfo;
|
||||
import org.apache.http.client.cache.CacheResponseStatus;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheContext;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.http.client.utils.URIUtils;
|
||||
import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.http.impl.execchain.ClientExecChain;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -86,9 +86,9 @@ import org.apache.http.impl.execchain.ClientExecChain;
|
|||
* Folks that would like to experiment with alternative storage backends
|
||||
* should look at the {@link HttpCacheStorage} interface and the related
|
||||
* package documentation there. You may also be interested in the provided
|
||||
* {@link org.apache.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage
|
||||
* {@link org.apache.hc.client5.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage
|
||||
* EhCache} and {@link
|
||||
* org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
|
||||
* org.apache.hc.client5.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
|
||||
* memcached} storage backends.
|
||||
* </p>
|
||||
* <p>
|
||||
|
@ -523,7 +523,7 @@ public class CachingExec implements ClientExecChain {
|
|||
return existingEntry;
|
||||
}
|
||||
|
||||
final VersionInfo vi = VersionInfo.loadVersionInfo("org.apache.http.client", getClass().getClassLoader());
|
||||
final VersionInfo vi = VersionInfo.loadVersionInfo("org.apache.hc.client5", getClass().getClassLoader());
|
||||
final String release = (vi != null) ? vi.getRelease() : VersionInfo.UNAVAILABLE;
|
||||
|
||||
String value;
|
|
@ -24,20 +24,20 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheInvalidator;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.http.impl.execchain.ClientExecChain;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheInvalidator;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.impl.client.HttpClientBuilder;
|
||||
import org.apache.hc.client5.http.impl.execchain.ClientExecChain;
|
||||
|
||||
/**
|
||||
* Builder for {@link org.apache.http.impl.client.CloseableHttpClient}
|
||||
* Builder for {@link org.apache.hc.client5.http.impl.client.CloseableHttpClient}
|
||||
* instances capable of client-side caching.
|
||||
*
|
||||
* @since 4.3
|
|
@ -25,12 +25,12 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.hc.client5.http.impl.client.CloseableHttpClient;
|
||||
|
||||
/**
|
||||
* Factory methods for {@link CloseableHttpClient} instances
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
|
@ -35,7 +35,7 @@ import java.io.SequenceInputStream;
|
|||
import org.apache.hc.core5.annotation.NotThreadSafe;
|
||||
import org.apache.hc.core5.http.entity.AbstractHttpEntity;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
|
||||
@NotThreadSafe
|
||||
class CombinedEntity extends AbstractHttpEntity {
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -32,9 +32,9 @@ import org.apache.hc.core5.annotation.Immutable;
|
|||
import org.apache.hc.core5.http.Header;
|
||||
import org.apache.hc.core5.http.HeaderElement;
|
||||
import org.apache.hc.core5.http.ProtocolException;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -33,9 +33,9 @@ import java.io.ObjectOutputStream;
|
|||
import java.io.OutputStream;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheEntrySerializationException;
|
||||
import org.apache.http.client.cache.HttpCacheEntrySerializer;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntrySerializationException;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntrySerializer;
|
||||
|
||||
/**
|
||||
* {@link HttpCacheEntrySerializer} implementation that uses the default (native)
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
|
@ -72,7 +72,7 @@ public class ExponentialBackOffSchedulingStrategy implements SchedulingStrategy
|
|||
/**
|
||||
* Create a new scheduling strategy using a fixed pool of worker threads.
|
||||
* @param cacheConfig the thread pool configuration to be used; not {@code null}
|
||||
* @see org.apache.http.impl.client.cache.CacheConfig#getAsynchronousWorkersMax()
|
||||
* @see org.apache.hc.client5.http.impl.client.cache.CacheConfig#getAsynchronousWorkersMax()
|
||||
* @see #DEFAULT_BACK_OFF_RATE
|
||||
* @see #DEFAULT_INITIAL_EXPIRY_IN_MILLIS
|
||||
* @see #DEFAULT_MAX_EXPIRY_IN_MILLIS
|
||||
|
@ -92,7 +92,7 @@ public class ExponentialBackOffSchedulingStrategy implements SchedulingStrategy
|
|||
* @param backOffRate the back off rate to be used; not negative
|
||||
* @param initialExpiryInMillis the initial expiry in milli seconds; not negative
|
||||
* @param maxExpiryInMillis the upper limit of the delay in milli seconds; not negative
|
||||
* @see org.apache.http.impl.client.cache.CacheConfig#getAsynchronousWorkersMax()
|
||||
* @see org.apache.hc.client5.http.impl.client.cache.CacheConfig#getAsynchronousWorkersMax()
|
||||
* @see ExponentialBackOffSchedulingStrategy
|
||||
*/
|
||||
public ExponentialBackOffSchedulingStrategy(
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
/**
|
||||
* Increase and reset the number of errors associated with a specific
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -32,7 +32,7 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
|
||||
import org.apache.hc.core5.annotation.ThreadSafe;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
|
||||
/**
|
||||
* Cache resource backed by a file.
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -32,9 +32,9 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
import org.apache.http.client.cache.InputLimit;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.client.cache.InputLimit;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
|
||||
/**
|
||||
* Generates {@link Resource} instances whose body is stored in a temporary file.
|
|
@ -24,13 +24,13 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
|
||||
/**
|
||||
* Cache resource backed by a byte array on the heap.
|
|
@ -24,16 +24,16 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
import org.apache.http.client.cache.InputLimit;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.client.cache.InputLimit;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
|
||||
/**
|
||||
* Generates {@link Resource} instances stored entirely in heap.
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
|
@ -33,8 +33,8 @@ import java.util.Map;
|
|||
import org.apache.hc.core5.http.HttpHost;
|
||||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.ExecutorService;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
|
@ -35,10 +35,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
import org.apache.hc.core5.annotation.ThreadSafe;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
|
@ -24,14 +24,14 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.lang.reflect.Proxy;
|
||||
|
||||
import org.apache.hc.core5.annotation.NotThreadSafe;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
|
||||
/**
|
||||
* Proxies for HTTP message objects.
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -46,9 +46,9 @@ import org.apache.hc.core5.http.entity.ContentType;
|
|||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||
import org.apache.hc.core5.http.message.BasicStatusLine;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.ClientProtocolException;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,15 +24,15 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.lang.ref.PhantomReference;
|
||||
import java.lang.ref.ReferenceQueue;
|
||||
|
||||
import org.apache.hc.core5.annotation.Immutable;
|
||||
import org.apache.hc.core5.util.Args;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
|
||||
@Immutable
|
||||
class ResourceReference extends PhantomReference<HttpCacheEntry> {
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
|
@ -42,8 +42,8 @@ import org.apache.hc.core5.http.HttpRequest;
|
|||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.hc.core5.http.HttpStatus;
|
||||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* Determines if an HttpResponse can be cached.
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -42,10 +42,10 @@ import org.apache.hc.core5.http.HttpResponse;
|
|||
import org.apache.hc.core5.http.HttpStatus;
|
||||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.ClientProtocolException;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -25,7 +25,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -35,10 +35,10 @@ import org.apache.hc.core5.http.HttpEntity;
|
|||
import org.apache.hc.core5.http.HttpRequest;
|
||||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||
import org.apache.http.client.cache.InputLimit;
|
||||
import org.apache.http.client.cache.Resource;
|
||||
import org.apache.http.client.cache.ResourceFactory;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.cache.InputLimit;
|
||||
import org.apache.hc.client5.http.client.cache.Resource;
|
||||
import org.apache.hc.client5.http.client.cache.ResourceFactory;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
|
||||
/**
|
||||
* @since 4.1
|
|
@ -24,9 +24,9 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
/** Records a set of information describing a cached variant. */
|
||||
class Variant {
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
@ -33,7 +33,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.hc.core5.http.Header;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
|
||||
/** This class provides for parsing and understanding Warning headers. As
|
||||
* the Warning header can be multi-valued, but the values can contain
|
|
@ -24,19 +24,19 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.ehcache;
|
||||
package org.apache.hc.client5.http.impl.client.cache.ehcache;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheEntrySerializer;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateException;
|
||||
import org.apache.http.impl.client.cache.CacheConfig;
|
||||
import org.apache.http.impl.client.cache.DefaultHttpCacheEntrySerializer;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntrySerializer;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateException;
|
||||
import org.apache.hc.client5.http.impl.client.cache.CacheConfig;
|
||||
import org.apache.hc.client5.http.impl.client.cache.DefaultHttpCacheEntrySerializer;
|
||||
|
||||
import net.sf.ehcache.Ehcache;
|
||||
import net.sf.ehcache.Element;
|
|
@ -49,10 +49,10 @@
|
|||
* information on the Apache Software Foundation, please see
|
||||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/package org.apache.http.impl.client.cache.memcached;
|
||||
*/package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
/**
|
||||
* Since the {@link org.apache.http.client.cache.HttpCacheStorage} interface
|
||||
* Since the {@link org.apache.hc.client5.http.client.cache.HttpCacheStorage} interface
|
||||
* expects to use variant-annotated URLs for its storage keys, but Memcached
|
||||
* has a maximum key size, we need to support mapping storage keys to cache
|
||||
* keys. Clients can implement this interface to change the way the mapping
|
|
@ -24,9 +24,9 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
/**
|
||||
* Provides for serialization and deserialization of higher-level
|
|
@ -24,9 +24,9 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
/**
|
||||
* Creates {@link MemcachedCacheEntry} instances that can be used for
|
|
@ -24,9 +24,9 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link MemcachedCacheEntryFactory}.
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -32,7 +32,7 @@ import java.io.IOException;
|
|||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link MemcachedCacheEntry}. This implementation
|
|
@ -24,18 +24,18 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.http.client.cache.HttpCacheUpdateException;
|
||||
import org.apache.http.impl.client.cache.CacheConfig;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheStorage;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateCallback;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheUpdateException;
|
||||
import org.apache.hc.client5.http.impl.client.cache.CacheConfig;
|
||||
|
||||
import net.spy.memcached.CASResponse;
|
||||
import net.spy.memcached.CASValue;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
/**
|
||||
* Indicates a problem encountered when trying to map a
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
/**
|
||||
* Raised when there is a problem serializing or deserializing cache
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
|
||||
/**
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache.memcached;
|
||||
package org.apache.hc.client5.http.impl.client.cache.memcached;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
|
@ -30,13 +30,13 @@ information on the Apache Software Foundation, please see
|
|||
<body bgcolor="white">
|
||||
|
||||
<p>
|
||||
This package contains a cache module that can be used for HTTP/1.1
|
||||
client-side caching. The primary classes in this package are the
|
||||
{@link org.apache.http.impl.client.cache.CachingHttpClient},
|
||||
which is a drop-in replacement for
|
||||
a {@link org.apache.http.impl.client.DefaultHttpClient} that adds
|
||||
caching, and the {@link org.apache.http.impl.client.cache.CacheConfig}
|
||||
class that can be used for configuring it.
|
||||
This package contains a cache module that can be used for HTTP/1.1
|
||||
client-side caching. The primary classes in this package are the
|
||||
{@link org.apache.hc.client5.http.impl.client.cache.CachingHttpClient},
|
||||
which is a drop-in replacement for
|
||||
a {@link org.apache.hc.client5.http.impl.client.DefaultHttpClient} that adds
|
||||
caching, and the {@link org.apache.hc.client5.http.impl.client.cache.CacheConfig}
|
||||
class that can be used for configuring it.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,78 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
||||
<html>
|
||||
<head>
|
||||
<!--
|
||||
====================================================================
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
====================================================================
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals on behalf of the Apache Software Foundation. For more
|
||||
information on the Apache Software Foundation, please see
|
||||
<http://www.apache.org/>.
|
||||
-->
|
||||
</head>
|
||||
<body bgcolor="white">
|
||||
|
||||
<p>
|
||||
This package consists largely of constants and interfaces that are
|
||||
necessary for building new storage backends for the
|
||||
{@link org.apache.http.impl.client.cache.CachingHttpClient} or for
|
||||
those clients wanting to get a little more behavioral information
|
||||
out of the cache module (for example, whether a particular response
|
||||
was a cache hit or not). Developers that simply want to instantiate
|
||||
and make use of the caching module will be better off looking at
|
||||
the {@code CachingHttpClient} documentation itself.
|
||||
</p>
|
||||
<p>
|
||||
The classes in this package can be divided into two main groups:
|
||||
reference constants and interfaces needed for storage backends. In
|
||||
the former group,
|
||||
{@link org.apache.http.client.cache.HeaderConstants} contains a list
|
||||
of HTTP header names encoded as static fields, and the
|
||||
{@link org.apache.http.client.cache.CacheResponseStatus} enumeration
|
||||
values are set in an {@link org.apache.http.protocol.HttpContext} by
|
||||
the {@code CachingHttpClient} to indicate how the request was
|
||||
processed by the caching module itself.
|
||||
</p>
|
||||
<p>
|
||||
New storage backends will need to implement the
|
||||
{@link org.apache.http.client.cache.HttpCacheStorage}
|
||||
interface; they can then be passed to one of the {@code CachingHttpClient}
|
||||
constructors, which will happily make use of the new storage mechanism.
|
||||
The {@link org.apache.http.client.cache.HttpCacheEntry} class shows the
|
||||
datastructure for a cache entry that must be stored by the
|
||||
{@code HttpCacheStorage}.
|
||||
There is, in addition, the notion of a
|
||||
{@link org.apache.http.client.cache.Resource} and an associated
|
||||
{@link org.apache.http.client.cache.ResourceFactory}, which are used for
|
||||
managing the handling of cached response bodies. The default implementation
|
||||
used by the {@code CachingHttpClient} stores response bodies in memory;
|
||||
alternative implementations might involve storing these in a filesystem. A new
|
||||
{@code ResourceFactory} can be provided along with a {@code HttpCacheStorage}
|
||||
in one of the constructors to the {@code CachingHttpClient}. Finally, some
|
||||
of the additional storage backends we provide, like the
|
||||
{@link org.apache.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage} and
|
||||
{@link org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage},
|
||||
can be provided with different serializers for the cache entry metadata;
|
||||
developers wanting to experiment with different serialization techniques
|
||||
should implement the
|
||||
{@link org.apache.http.client.cache.HttpCacheEntrySerializer} interface.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.client.cache;
|
||||
package org.apache.hc.client5.http.client.cache;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
@ -45,7 +45,7 @@ import org.apache.hc.core5.http.HttpVersion;
|
|||
import org.apache.hc.core5.http.StatusLine;
|
||||
import org.apache.hc.core5.http.message.BasicHeader;
|
||||
import org.apache.hc.core5.http.message.BasicStatusLine;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
@ -34,13 +34,13 @@ import org.apache.hc.core5.http.HttpRequest;
|
|||
import org.apache.hc.core5.http.HttpResponse;
|
||||
import org.apache.hc.core5.http.HttpVersion;
|
||||
import org.apache.hc.core5.http.message.BasicHttpRequest;
|
||||
import org.apache.http.client.cache.HttpCacheContext;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.http.impl.execchain.ClientExecChain;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheContext;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.conn.routing.HttpRoute;
|
||||
import org.apache.hc.client5.http.impl.execchain.ClientExecChain;
|
||||
import org.easymock.EasyMock;
|
||||
import org.easymock.IExpectationSetters;
|
||||
import org.junit.Before;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
public class Counter {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
@ -34,12 +34,12 @@ import org.apache.hc.core5.http.HttpResponse;
|
|||
import org.apache.hc.core5.http.HttpStatus;
|
||||
import org.apache.hc.core5.http.ProtocolVersion;
|
||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.http.client.protocol.HttpClientContext;
|
||||
import org.apache.http.conn.routing.HttpRoute;
|
||||
import org.apache.http.impl.execchain.ClientExecChain;
|
||||
import org.apache.hc.client5.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.hc.client5.http.client.methods.HttpExecutionAware;
|
||||
import org.apache.hc.client5.http.client.methods.HttpRequestWrapper;
|
||||
import org.apache.hc.client5.http.client.protocol.HttpClientContext;
|
||||
import org.apache.hc.client5.http.conn.routing.HttpRoute;
|
||||
import org.apache.hc.client5.http.impl.execchain.ClientExecChain;
|
||||
|
||||
public class DummyBackend implements ClientExecChain {
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
* <http://www.apache.org/>.
|
||||
*
|
||||
*/
|
||||
package org.apache.http.impl.client.cache;
|
||||
package org.apache.hc.client5.http.impl.client.cache;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Date;
|
||||
|
@ -47,9 +47,9 @@ import org.apache.hc.core5.http.message.BasicHeader;
|
|||
import org.apache.hc.core5.http.message.BasicHttpRequest;
|
||||
import org.apache.hc.core5.http.message.BasicHttpResponse;
|
||||
import org.apache.hc.core5.http.message.BasicStatusLine;
|
||||
import org.apache.http.client.cache.HeaderConstants;
|
||||
import org.apache.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.apache.hc.client5.http.client.cache.HeaderConstants;
|
||||
import org.apache.hc.client5.http.client.cache.HttpCacheEntry;
|
||||
import org.apache.hc.client5.http.client.utils.DateUtils;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class HttpTestUtils {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue