public void executeMethod(final HttpMethod method, final ClientRequest cr) {
final Map<String, Object> props = cr.getProperties();
method.setDoAuthentication(true);
final HttpMethodParams methodParams = method.getParams();
// Set the handle cookies property
if (!cr.getPropertyAsFeature(ApacheHttpClientConfig.PROPERTY_HANDLE_COOKIES)) {
methodParams.setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
}
// Set the interactive and credential provider properties
if (cr.getPropertyAsFeature(ApacheHttpClientConfig.PROPERTY_INTERACTIVE)) {
CredentialsProvider provider = (CredentialsProvider) props.get(
ApacheHttpClientConfig.PROPERTY_CREDENTIALS_PROVIDER);
if (provider == null) {
provider = DEFAULT_CREDENTIALS_PROVIDER;
}
methodParams.setParameter(CredentialsProvider.PROVIDER, provider);
} else {
methodParams.setParameter(CredentialsProvider.PROVIDER, null);
}
// Set the read timeout
final Integer readTimeout = (Integer) props.get(ApacheHttpClientConfig.PROPERTY_READ_TIMEOUT);
if (readTimeout != null) {
methodParams.setSoTimeout(readTimeout);
}
if (method instanceof EntityEnclosingMethod) {
final EntityEnclosingMethod entMethod = (EntityEnclosingMethod) method;