Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2012-09-11 20:57:44 +0000
committerslewis2012-09-11 20:57:44 +0000
commit3a33149335bfd4599be216725ade2e69449111f4 (patch)
tree2a8c38df8ec50736a71ef059142189c46e0c3e52
parent74f73c825f4396780ed530711f66ddd57813640a (diff)
downloadorg.eclipse.ecf-3a33149335bfd4599be216725ade2e69449111f4.tar.gz
org.eclipse.ecf-3a33149335bfd4599be216725ade2e69449111f4.tar.xz
org.eclipse.ecf-3a33149335bfd4599be216725ade2e69449111f4.zip
Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java56
2 files changed, 44 insertions, 14 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF
index 746589781..67440751e 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.provider.filetransfer.httpclient4;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.0.100.qualifier
Bundle-Localization: plugin
Bundle-Activator: org.eclipse.ecf.internal.provider.filetransfer.httpclient4.Activator
Require-Bundle: org.eclipse.equinox.common,
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java
index ae5b3093e..f8901b533 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer.httpclient4/src/org/eclipse/ecf/provider/filetransfer/httpclient4/HttpClientRetrieveFileTransfer.java
@@ -13,15 +13,7 @@
******************************************************************************/
package org.eclipse.ecf.provider.filetransfer.httpclient4;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.Activator;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ConnectingSocketMonitor;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.DebugOptions;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ECFHttpClientProtocolSocketFactory;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ECFHttpClientSecureProtocolSocketFactory;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.HttpClientProxyCredentialProvider;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ISSLSocketFactoryModifier;
-import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.Messages;
-
+import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
@@ -88,6 +80,14 @@ import org.eclipse.ecf.filetransfer.events.IFileTransferConnectStartEvent;
import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource;
import org.eclipse.ecf.filetransfer.events.socket.ISocketListener;
import org.eclipse.ecf.filetransfer.identity.IFileID;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.Activator;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ConnectingSocketMonitor;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.DebugOptions;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ECFHttpClientProtocolSocketFactory;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ECFHttpClientSecureProtocolSocketFactory;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.HttpClientProxyCredentialProvider;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.ISSLSocketFactoryModifier;
+import org.eclipse.ecf.internal.provider.filetransfer.httpclient4.Messages;
import org.eclipse.ecf.provider.filetransfer.events.socket.SocketEventSource;
import org.eclipse.ecf.provider.filetransfer.identity.FileTransferID;
import org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer;
@@ -271,13 +271,30 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
* @see org.eclipse.ecf.provider.filetransfer.retrieve.AbstractRetrieveFileTransfer#hardClose()
*/
protected void hardClose() {
- super.hardClose();
+ // changed for addressing bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292
if (getMethod != null) {
- getMethod.abort();
+ // First, if !isDone and paused
+ if (!isDone() && isPaused())
+ getMethod.abort();
+ // release in any case
+ //getMethod.releaseConnection();
+ // and set to null
getMethod = null;
}
+ // Close output stream...if we're supposed to
+ try {
+ if (localFileContents != null && closeOutputStream)
+ localFileContents.close();
+ } catch (final IOException e) {
+ Activator.getDefault().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, "hardClose", e)); //$NON-NLS-1$
+ }
+ // clear input and output streams
+ remoteFileContents = null;
+ localFileContents = null;
+ // reset response code
responseCode = -1;
- if (proxyHelper != null) {
+ // If we're done and proxy helper still exists, then dispose
+ if (proxyHelper != null && isDone()) {
proxyHelper.dispose();
proxyHelper = null;
}
@@ -477,7 +494,20 @@ public class HttpClientRetrieveFileTransfer extends AbstractRetrieveFileTransfer
}
protected InputStream wrapTransferReadInputStream(InputStream inputStream, IProgressMonitor monitor) {
- return inputStream;
+ // Added to address bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292
+ return new NoCloseWrapperInputStream(inputStream);
+ }
+
+ // Added to address bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=389292
+ class NoCloseWrapperInputStream extends FilterInputStream {
+
+ protected NoCloseWrapperInputStream(InputStream in) {
+ super(in);
+ }
+
+ public void close() {
+ // do nothing
+ }
}
protected boolean hasForceNTLMProxyOption() {

Back to the top