Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMat Booth2019-05-29 12:44:45 -0400
committerMat Booth2019-05-29 12:45:32 -0400
commit4eef8c9b66f035b9b520da7fbabccd0ed4530210 (patch)
tree53efe1974d08b8a4db456aa425cc5093b57ac5de
parent3fc35d8e4432318c5bf3b8824104cecd7d870894 (diff)
downloadorg.eclipse.ecf-4eef8c9b66f035b9b520da7fbabccd0ed4530210.tar.gz
org.eclipse.ecf-4eef8c9b66f035b9b520da7fbabccd0ed4530210.tar.xz
org.eclipse.ecf-4eef8c9b66f035b9b520da7fbabccd0ed4530210.zip
Bug 544447 - [provider] Implement filetransfer provider using HttpClient 4.5 API
Set the ConnectionRequestTimeout value in the httpclient to be the same as the ConnectTimeout value. This value was being set in the ECFHttpClientFactory class using the provider specific properties, but not in the HttpClientRetrieveFileTransfer class where it applies the values from the generic properties. Change-Id: Ife00ae81f08b3a96d13855d2844ef72d19b84fbe Signed-off-by: Mat Booth <mat.booth@redhat.com>
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java
index ff38bbcc8..80630635b 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient45/src/org/eclipse/ecf/provider/filetransfer/httpclient45/HttpClientRetrieveFileTransfer.java
@@ -481,16 +481,16 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
if (o instanceof Integer) {
result = ((Integer) o).intValue();
} else if (o instanceof String) {
- result = new Integer(((String) o)).intValue();
+ result = Integer.parseInt((String) o);
}
return result;
}
- o = localOptions.get("org.eclipse.ecf.provider.filetransfer.httpclient4.retrieve.readTimeout"); //$NON-NLS-1$
+ o = localOptions.get(HttpClientOptions.RETRIEVE_READ_TIMEOUT_PROP);
if (o != null) {
if (o instanceof Integer) {
result = ((Integer) o).intValue();
} else if (o instanceof String) {
- result = new Integer(((String) o)).intValue();
+ result = Integer.parseInt((String) o);
}
}
}
@@ -511,16 +511,16 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
if (o instanceof Integer) {
result = ((Integer) o).intValue();
} else if (o instanceof String) {
- result = new Integer(((String) o)).intValue();
+ result = Integer.parseInt((String) o);
}
return result;
}
- o = localOptions.get("org.eclipse.ecf.provider.filetransfer.httpclient4.retrieve.connectTimeout"); //$NON-NLS-1$
+ o = localOptions.get(HttpClientOptions.RETRIEVE_CONNECTION_TIMEOUT_PROP);
if (o != null) {
if (o instanceof Integer) {
result = ((Integer) o).intValue();
} else if (o instanceof String) {
- result = new Integer(((String) o)).intValue();
+ result = Integer.parseInt((String) o);
}
}
}
@@ -542,7 +542,7 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
try {
getMethod = new HttpGet(urlString);
RequestConfig.Builder rcfgBuilder = getRequestConfigBuilder();
- rcfgBuilder.setSocketTimeout(getSocketReadTimeout()).setConnectTimeout(getConnectTimeout());
+ rcfgBuilder.setSocketTimeout(getSocketReadTimeout()).setConnectTimeout(getConnectTimeout()).setConnectionRequestTimeout(getConnectTimeout());
setupAuthentication(urlString);
@@ -616,7 +616,7 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
} else {
Trace.trace(Activator.PLUGIN_ID, EntityUtils.toString(httpResponse.getEntity()));
// EntityUtils.consume(httpResponse.getEntity());
- throw new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, new Integer(code)), code);
+ throw new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, Integer.valueOf(code)), code);
}
} catch (final Exception e) {
Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, this.getClass(), "openStreams", e); //$NON-NLS-1$
@@ -860,7 +860,7 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
throw new IncomingFileTransferException(Messages.HttpClientRetrieveFileTransfer_Proxy_Auth_Required, code, responseHeaders);
} else {
EntityUtils.consume(httpResponse.getEntity());
- throw new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, new Integer(code)), code, responseHeaders);
+ throw new IncomingFileTransferException(NLS.bind(Messages.HttpClientRetrieveFileTransfer_ERROR_GENERAL_RESPONSE_CODE, Integer.valueOf(code)), code, responseHeaders);
}
Trace.exiting(Activator.PLUGIN_ID, DebugOptions.METHODS_EXITING, this.getClass(), "openStreamsForResume", Boolean.TRUE); //$NON-NLS-1$
return true;

Back to the top