Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2008-11-25 11:08:09 +0000
committerTomasz Zarna2008-11-25 11:08:09 +0000
commit3e669f90e9d5afa1f70637b73694627e3a5c0049 (patch)
treedb8d5beba69a424242ee062889252a7b5a593d26 /bundles/org.eclipse.core.net/src
parentbd237dccad66b6a8844167eae542c501551dbe92 (diff)
downloadeclipse.platform.team-3e669f90e9d5afa1f70637b73694627e3a5c0049.tar.gz
eclipse.platform.team-3e669f90e9d5afa1f70637b73694627e3a5c0049.tar.xz
eclipse.platform.team-3e669f90e9d5afa1f70637b73694627e3a5c0049.zip
bug 256081: [Net] Remove unnecessary API from IProxyData
Diffstat (limited to 'bundles/org.eclipse.core.net/src')
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java16
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java4
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java2
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java2
-rw-r--r--bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java51
5 files changed, 20 insertions, 55 deletions
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java
index ee7a83e58..8c143d270 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/ProxySelector.java
@@ -56,19 +56,25 @@ public class ProxySelector {
}
}
- public static IProxyData[] getProxyData(String provider) {
+ public static ProxyData[] getProxyData(String provider) {
ProxyManager manager = (ProxyManager) ProxyManager.getProxyManager();
if (provider.equals(DIRECT_PROVIDER)) {
- return new IProxyData[0];
+ return new ProxyData[0];
} else if (provider.equals(ECLIPSE_PROVIDER)) {
- return manager.getProxyData();
+ return castArray(manager.getProxyData());
} else if (provider.equals(NATIVE_PROVIDER)) {
- return manager.getNativeProxyData();
+ return castArray(manager.getNativeProxyData());
}
throw new IllegalArgumentException("Provider not supported"); //$NON-NLS-1$
}
- public static void setProxyData(String provider, IProxyData proxies[]) {
+ private static ProxyData[] castArray(IProxyData data[]) {
+ ProxyData[] ret = new ProxyData[data.length];
+ System.arraycopy(data, 0, ret, 0, data.length);
+ return ret;
+ }
+
+ public static void setProxyData(String provider, ProxyData proxies[]) {
if (provider.equals(ECLIPSE_PROVIDER)) {
IProxyService service = ProxyManager.getProxyManager();
try {
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
index 4c44efc66..9a98c6f92 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/ProxyProviderUtil.java
@@ -153,7 +153,7 @@ public final class ProxyProviderUtil {
private static IProxyData createProxy(String scheme, String host, int port) {
String type = resolveProxyType(scheme);
- IProxyData proxy = new ProxyData(type);
+ ProxyData proxy = new ProxyData(type);
proxy.setHost(host);
proxy.setPort(port);
proxy.setSource("WINDOWS_IE"); //$NON-NLS-1$
@@ -224,7 +224,7 @@ public final class ProxyProviderUtil {
String hostname = getHostname(pacHostnameAndPort);
if (hostname != null) {
int port = getPort(pacHostnameAndPort);
- IProxyData proxy = new ProxyData(proxyType);
+ ProxyData proxy = new ProxyData(proxyType);
proxy.setHost(hostname);
proxy.setPort(port);
proxy.setSource("WINDOWS_IE"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java
index f6b6c2b21..2184fdccd 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/StaticProxyConfig.java
@@ -107,7 +107,7 @@ public class StaticProxyConfig {
return new IProxyData[0];
}
IProxyData[] data = new IProxyData[KNOWN_TYPES.length];
- IProxyData universal = (IProxyData) universalProxies.get(0);
+ ProxyData universal = (ProxyData) universalProxies.get(0);
for (int i = 0; i < KNOWN_TYPES.length; i++) {
ProxyData newData = new ProxyData(KNOWN_TYPES[i], universal
.getHost(), universal.getPort(), universal
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java
index 50082622e..05a284d42 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/internal/net/proxy/win32/winhttp/WinHttpProxyProvider.java
@@ -107,7 +107,7 @@ public class WinHttpProxyProvider {
if (!tryPac && wpadAutoConfigUrl == null)
return new IProxyData[0];
- IProxyData data = new ProxyData(IProxyData.HTTP_PROXY_TYPE, "", -1, //$NON-NLS-1$
+ ProxyData data = new ProxyData(IProxyData.HTTP_PROXY_TYPE, "", -1, //$NON-NLS-1$
false, "WINDOWS_IE"); //$NON-NLS-1$
data.setDynamic(true);
return new IProxyData[] { data };
diff --git a/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java b/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java
index 951bad22d..f9ca16235 100644
--- a/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java
+++ b/bundles/org.eclipse.core.net/src/org/eclipse/core/net/proxy/IProxyData.java
@@ -140,52 +140,11 @@ public interface IProxyData {
boolean isRequiresAuthentication();
/**
- * Returns the proxy source name. This value is useful for diagnosing
- * purposes since many OS specific proxy sources could be available in a
- * single environment. Null value means that the setting come from Eclipse
- * preferences and is not OS specific.
- *
- * @since 1.2
- * @return name of the proxy setting source, might be <code>null</code>
- */
- String getSource();
-
- /**
- * Sets the proxy source name. This value is useful for diagnosing purposes
- * since many OS specific proxy sources could be available in a single
- * environment. Null value means that the setting comes from Eclipse
- * preferences and is not OS specific.
- *
- * @param source
- * proxy setting source name to be set, might be
- * <code>null</code>
- * @since 1.2
- */
- void setSource(String source);
-
- /**
- * Returns if the proxy data is obtained from a dynamic source, a PAC script
- * for example.
- *
- * @return if proxy setting is dynamic
- * @since 1.2
- */
- boolean isDynamic();
-
- /**
- * Sets if the proxy data is obtained from a dynamic source, a PAC script
- * for example.
- *
- * @param dynamic if proxy setting is dynamic
- * @since 1.2
- */
- void setDynamic(boolean dynamic);
-
- /**
- * Set the values of this data to represent a disabling of its type. Note
- * that the proxy type will not be disabled unless the client calls
- * {@link IProxyService#setProxyData(IProxyData[])} with the disabled data
- * as a parameter. A proxy data can be enabled by setting the host.
+ * Set the values of this data to represent a disabling of its type.
+ * Note that the proxy type will not be disabled unless the client
+ * calls {@link IProxyService#setProxyData(IProxyData[])} with the
+ * disabled data as a parameter. A proxy data can be enabled by setting
+ * the host.
*/
void disable();

Back to the top