Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2010-05-07 14:51:30 -0400
committerslewis2010-05-07 14:51:30 -0400
commit3f9621e7a9a06f5afa21b83da20a58437e0c0319 (patch)
tree750c74f8206fc82365d32239a548b459fe9add7f /providers/bundles/org.eclipse.ecf.provider.filetransfer
parentea65318c6b2b7e677a50d3935486d6d5a7c5228b (diff)
downloadorg.eclipse.ecf-3f9621e7a9a06f5afa21b83da20a58437e0c0319.tar.gz
org.eclipse.ecf-3f9621e7a9a06f5afa21b83da20a58437e0c0319.tar.xz
org.eclipse.ecf-3f9621e7a9a06f5afa21b83da20a58437e0c0319.zip
Fixes for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=312067
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.filetransfer')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java5
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/browse/AbstractFileSystemBrowser.java21
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/outgoing/AbstractOutgoingFileTransfer.java11
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/retrieve/AbstractRetrieveFileTransfer.java11
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/util/ProxySetupHelper.java6
5 files changed, 42 insertions, 12 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java
index 9478ae57a..b254937f4 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/Activator.java
@@ -208,7 +208,10 @@ public class Activator implements BundleActivator, IFileTransferProtocolToFactor
}
public static void logNoProxyWarning(Throwable e) {
- getDefault().log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, IStatus.ERROR, "Warning: Platform proxy API not available", e)); //$NON-NLS-1$
+ Activator a = getDefault();
+ if (a != null) {
+ a.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, IStatus.ERROR, "Warning: Platform proxy API not available", e)); //$NON-NLS-1$
+ }
}
public void log(IStatus status) {
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/browse/AbstractFileSystemBrowser.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/browse/AbstractFileSystemBrowser.java
index b75fa3835..0a911a214 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/browse/AbstractFileSystemBrowser.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/browse/AbstractFileSystemBrowser.java
@@ -12,8 +12,6 @@
package org.eclipse.ecf.provider.filetransfer.browse;
-import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper;
-
import java.net.URL;
import java.util.Arrays;
import java.util.List;
@@ -32,7 +30,9 @@ import org.eclipse.ecf.filetransfer.UserCancelledException;
import org.eclipse.ecf.filetransfer.events.IRemoteFileSystemBrowseEvent;
import org.eclipse.ecf.filetransfer.events.IRemoteFileSystemEvent;
import org.eclipse.ecf.filetransfer.identity.IFileID;
+import org.eclipse.ecf.internal.provider.filetransfer.Activator;
import org.eclipse.ecf.internal.provider.filetransfer.Messages;
+import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper;
/**
* Abstract class for browsing an efs file system.
@@ -209,13 +209,26 @@ public abstract class AbstractFileSystemBrowser {
* @return proxy data selected from the proxies provided.
*/
protected IProxyData selectProxyFromProxies(String protocol, IProxyData[] proxies) {
- return ProxySetupHelper.selectProxyFromProxies(protocol, proxies);
+ try {
+ return ProxySetupHelper.selectProxyFromProxies(protocol, proxies);
+ } catch (NoClassDefFoundError e) {
+ // If the proxy API is not available a NoClassDefFoundError will be thrown here.
+ // If that happens then we just want to continue on.
+ Activator.logNoProxyWarning(e);
+ return null;
+ }
}
protected void setupProxies() {
// If it's been set directly (via ECF API) then this overrides platform settings
if (proxy == null) {
- proxy = ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
+ try {
+ proxy = ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
+ } catch (NoClassDefFoundError e) {
+ // If the proxy API is not available a NoClassDefFoundError will be thrown here.
+ // If that happens then we just want to continue on.
+ Activator.logNoProxyWarning(e);
+ }
}
if (proxy != null)
setupProxy(proxy);
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/outgoing/AbstractOutgoingFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/outgoing/AbstractOutgoingFileTransfer.java
index 6d93be26d..6e2ca6b34 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/outgoing/AbstractOutgoingFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/outgoing/AbstractOutgoingFileTransfer.java
@@ -10,8 +10,6 @@
******************************************************************************/
package org.eclipse.ecf.provider.filetransfer.outgoing;
-import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper;
-
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -48,6 +46,7 @@ import org.eclipse.ecf.filetransfer.service.ISendFileTransfer;
import org.eclipse.ecf.internal.provider.filetransfer.Activator;
import org.eclipse.ecf.internal.provider.filetransfer.Messages;
import org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace;
+import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper;
import org.eclipse.osgi.util.NLS;
/**
@@ -357,7 +356,13 @@ public abstract class AbstractOutgoingFileTransfer implements IOutgoingFileTrans
protected void setupProxies() {
// If it's been set directly (via ECF API) then this overrides platform settings
if (proxy == null) {
- proxy = ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
+ try {
+ proxy = ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
+ } catch (NoClassDefFoundError e) {
+ // If the proxy API is not available a NoClassDefFoundError will be thrown here.
+ // If that happens then we just want to continue on.
+ Activator.logNoProxyWarning(e);
+ }
}
if (proxy != null)
setupProxy(proxy);
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/retrieve/AbstractRetrieveFileTransfer.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/retrieve/AbstractRetrieveFileTransfer.java
index 41f90661e..e90a34321 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/retrieve/AbstractRetrieveFileTransfer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/retrieve/AbstractRetrieveFileTransfer.java
@@ -12,8 +12,6 @@
******************************************************************************/
package org.eclipse.ecf.provider.filetransfer.retrieve;
-import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper;
-
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
@@ -60,6 +58,7 @@ import org.eclipse.ecf.internal.provider.filetransfer.Activator;
import org.eclipse.ecf.internal.provider.filetransfer.Messages;
import org.eclipse.ecf.provider.filetransfer.identity.FileTransferNamespace;
import org.eclipse.ecf.provider.filetransfer.util.PollingInputStream;
+import org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper;
import org.eclipse.ecf.provider.filetransfer.util.TimeoutInputStream;
import org.eclipse.osgi.util.NLS;
@@ -941,7 +940,13 @@ public abstract class AbstractRetrieveFileTransfer implements IIncomingFileTrans
// If it's been set directly (via ECF API) then this overrides platform
// settings
if (proxy == null) {
- proxy = ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
+ try {
+ proxy = ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
+ } catch (NoClassDefFoundError e) {
+ // If the proxy API is not available a NoClassDefFoundError will be thrown here.
+ // If that happens then we just want to continue on.
+ Activator.logNoProxyWarning(e);
+ }
}
if (proxy != null)
setupProxy(proxy);
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/util/ProxySetupHelper.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/util/ProxySetupHelper.java
index 8e1b9e5a2..680b02951 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/util/ProxySetupHelper.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/util/ProxySetupHelper.java
@@ -19,7 +19,11 @@ import org.eclipse.ecf.core.util.ProxyAddress;
import org.eclipse.ecf.internal.provider.filetransfer.Activator;
/**
- * Proxy setup utilities.
+ * Proxy setup utilities.
+ *
+ * NOTE: Use of this class implies the presence of the core.net.proxy
+ * API...this class will not load (NoClassDefFoundError will be thrown if load/use is attempted)
+ * if the core.net.proxy bundle is not present in the runtime.
*
* @noextend This class is not intended to be extended by clients.
* @since 3.1

Back to the top