|
|
|
@ -20,21 +20,21 @@ import java.io.Closeable;
|
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.net.URI; |
|
|
|
|
|
|
|
|
|
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.HttpEntityEnclosingRequestBase; |
|
|
|
|
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.methods.HttpUriRequest; |
|
|
|
|
import org.apache.http.client.protocol.HttpClientContext; |
|
|
|
|
import org.apache.http.impl.client.HttpClients; |
|
|
|
|
import org.apache.http.protocol.HttpContext; |
|
|
|
|
import com.fr.third.org.apache.http.client.HttpClient; |
|
|
|
|
import com.fr.third.org.apache.http.client.config.RequestConfig; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.Configurable; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpEntityEnclosingRequestBase; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpGet; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpHead; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpOptions; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpPatch; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpPost; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpPut; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpTrace; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpUriRequest; |
|
|
|
|
import com.fr.third.org.apache.http.client.protocol.HttpClientContext; |
|
|
|
|
import com.fr.third.org.apache.http.impl.client.HttpClients; |
|
|
|
|
import com.fr.third.org.apache.http.protocol.HttpContext; |
|
|
|
|
|
|
|
|
|
import com.fr.third.springframework.beans.factory.DisposableBean; |
|
|
|
|
import com.fr.third.springframework.http.HttpMethod; |
|
|
|
@ -64,7 +64,7 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
|
|
|
|
static { |
|
|
|
|
try { |
|
|
|
|
// Looking for AbstractHttpClient class (deprecated as of HttpComponents 4.3)
|
|
|
|
|
abstractHttpClientClass = ClassUtils.forName("org.apache.http.impl.client.AbstractHttpClient", |
|
|
|
|
abstractHttpClientClass = ClassUtils.forName("com.fr.third.org.apache.http.impl.client.AbstractHttpClient", |
|
|
|
|
HttpComponentsClientHttpRequestFactory.class.getClassLoader()); |
|
|
|
|
} |
|
|
|
|
catch (ClassNotFoundException ex) { |
|
|
|
@ -146,7 +146,7 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
|
private void setLegacyConnectionTimeout(HttpClient client, int timeout) { |
|
|
|
|
if (abstractHttpClientClass != null && abstractHttpClientClass.isInstance(client)) { |
|
|
|
|
client.getParams().setIntParameter(org.apache.http.params.CoreConnectionPNames.CONNECTION_TIMEOUT, timeout); |
|
|
|
|
client.getParams().setIntParameter(com.fr.third.org.apache.http.params.CoreConnectionPNames.CONNECTION_TIMEOUT, timeout); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -187,7 +187,7 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
|
|
|
|
@SuppressWarnings("deprecation") |
|
|
|
|
private void setLegacySocketTimeout(HttpClient client, int timeout) { |
|
|
|
|
if (abstractHttpClientClass != null && abstractHttpClientClass.isInstance(client)) { |
|
|
|
|
client.getParams().setIntParameter(org.apache.http.params.CoreConnectionPNames.SO_TIMEOUT, timeout); |
|
|
|
|
client.getParams().setIntParameter(com.fr.third.org.apache.http.params.CoreConnectionPNames.SO_TIMEOUT, timeout); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -342,7 +342,7 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Shutdown hook that closes the underlying |
|
|
|
|
* {@link org.apache.http.conn.HttpClientConnectionManager ClientConnectionManager}'s |
|
|
|
|
* {@link com.fr.third.org.apache.http.conn.HttpClientConnectionManager ClientConnectionManager}'s |
|
|
|
|
* connection pool, if any. |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
@ -355,9 +355,9 @@ public class HttpComponentsClientHttpRequestFactory implements ClientHttpRequest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* An alternative to {@link org.apache.http.client.methods.HttpDelete} that |
|
|
|
|
* extends {@link org.apache.http.client.methods.HttpEntityEnclosingRequestBase} |
|
|
|
|
* rather than {@link org.apache.http.client.methods.HttpRequestBase} and |
|
|
|
|
* An alternative to {@link com.fr.third.org.apache.http.client.methods.HttpDelete} that |
|
|
|
|
* extends {@link com.fr.third.org.apache.http.client.methods.HttpEntityEnclosingRequestBase} |
|
|
|
|
* rather than {@link com.fr.third.org.apache.http.client.methods.HttpRequestBase} and |
|
|
|
|
* hence allows HTTP delete with a request body. For use with the RestTemplate |
|
|
|
|
* exchange methods which allow the combination of HTTP DELETE with an entity. |
|
|
|
|
* @since 4.1.2 |
|
|
|
|