org.eclipse.ecf.provider.filetransfer.util
Class ProxySetupHelper

java.lang.Object
  extended by org.eclipse.ecf.provider.filetransfer.util.ProxySetupHelper

public class ProxySetupHelper
extends java.lang.Object

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.

Since:
3.1
NoExtend
This class is not intended to be extended by clients.

Constructor Summary
ProxySetupHelper()
           
 
Method Summary
static Proxy getProxy(java.lang.String url)
           
static Proxy getSocksProxy(java.net.URL url)
           
static org.eclipse.core.net.proxy.IProxyData selectProxyFromProxies(java.lang.String protocol, org.eclipse.core.net.proxy.IProxyData[] proxies)
          Select a single proxy from a set of proxies available for the given host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxySetupHelper

public ProxySetupHelper()
Method Detail

getProxy

public static Proxy getProxy(java.lang.String url)

getSocksProxy

public static Proxy getSocksProxy(java.net.URL url)

selectProxyFromProxies

public static org.eclipse.core.net.proxy.IProxyData selectProxyFromProxies(java.lang.String protocol,
                                                                           org.eclipse.core.net.proxy.IProxyData[] proxies)
Select a single proxy from a set of proxies available for the given host. This implementation selects in the following manner: 1) If proxies provided is null or array of 0 length, null is returned. If only one proxy is available (array of length 1) then the entry is returned. If proxies provided is length > 1, then if the type of a proxy in the array matches the given protocol (e.g. http, https), then the first matching proxy is returned. If the protocol does not match any of the proxies, then the *first* proxy (i.e. proxies[0]) is returned.

Parameters:
protocol - the target protocol (e.g. http, https, scp, etc). Will not be null.
proxies - the proxies to select from. May be null or array of length 0.
Returns:
proxy data selected from the proxies provided.