@Test public void testSelect_HTTPS() throws UnknownHostException { systemProperties.setProperty(HTTPS_PROXY_HOST, LOCALHOST); systemProperties.setProperty(HTTPS_PROXY_PORT, TEST_PORT_STR); JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault(), systemProperties); ProxySelector.setDefault(ps); List<Proxy> list = ps.select(testHttpsUri); assertEquals(list.get(0), new Proxy(Type.HTTP , new InetSocketAddress(InetAddress.getByName(LOCALHOST), TEST_PORT_NUM))); }
@Override public List<Proxy> select(URI uri) { List<Proxy> list = Lists.newArrayList(); if (uri == null) { throw new IllegalArgumentException("URI can't be null."); } String scheme = uri.getScheme().toLowerCase(); if (SUPPORTED_SCHEMES.contains(scheme)){ Proxy proxy = getProxy(scheme, proxyProperties.getProperty(scheme + "." + PROXY_HOST), proxyProperties.getProperty(scheme + "." + PROXY_PORT), proxyProperties.getProperty(scheme + "." + PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (scheme.startsWith("http") || "ftp".equals(scheme) || scheme.startsWith("socks")){ Proxy proxy = getProxy("socks", proxyProperties.getProperty(SOCKS_PROXY_HOST), proxyProperties.getProperty(SOCKS_PROXY_PORT), proxyProperties.getProperty(SOCKS_PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (list.size() > 0) { return list; } return delegateSelect(uri); }
JaxWsProxySelector extends ProxySelector { @Override public List<Proxy> select(URI uri) { List<Proxy> list = Lists.newArrayList(); if (uri == null) { throw new IllegalArgumentException("URI can't be null."); } String scheme = uri.getScheme().toLowerCase(); if (SUPPORTED_SCHEMES.contains(scheme)){ Proxy proxy = getProxy(scheme, proxyProperties.getProperty(scheme + "." + PROXY_HOST), proxyProperties.getProperty(scheme + "." + PROXY_PORT), proxyProperties.getProperty(scheme + "." + PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (scheme.startsWith("http") || "ftp".equals(scheme) || scheme.startsWith("socks")){ Proxy proxy = getProxy("socks", proxyProperties.getProperty(SOCKS_PROXY_HOST), proxyProperties.getProperty(SOCKS_PROXY_PORT), proxyProperties.getProperty(SOCKS_PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (list.size() > 0) { return list; } return delegateSelect(uri); } }
JaxWsProxySelector extends ProxySelector { @Override public List<Proxy> select(URI uri) { List<Proxy> list = Lists.newArrayList(); if (uri == null) { throw new IllegalArgumentException("URI can't be null."); } String scheme = uri.getScheme().toLowerCase(); if (SUPPORTED_SCHEMES.contains(scheme)){ Proxy proxy = getProxy(scheme, proxyProperties.getProperty(scheme + "." + PROXY_HOST), proxyProperties.getProperty(scheme + "." + PROXY_PORT), proxyProperties.getProperty(scheme + "." + PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (scheme.startsWith("http") || "ftp".equals(scheme) || scheme.startsWith("socks")){ Proxy proxy = getProxy("socks", proxyProperties.getProperty(SOCKS_PROXY_HOST), proxyProperties.getProperty(SOCKS_PROXY_PORT), proxyProperties.getProperty(SOCKS_PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (list.size() > 0) { return list; } return delegateSelect(uri); } JaxWsProxySelector(@Nullable ProxySelector proxySelector, Properties properties);  JaxWsProxySelector(@Nullable ProxySelector proxySelector); }
JaxWsProxySelector extends ProxySelector { @Override public List<Proxy> select(URI uri) { List<Proxy> list = Lists.newArrayList(); if (uri == null) { throw new IllegalArgumentException("URI can't be null."); } String scheme = uri.getScheme().toLowerCase(); if (SUPPORTED_SCHEMES.contains(scheme)){ Proxy proxy = getProxy(scheme, proxyProperties.getProperty(scheme + "." + PROXY_HOST), proxyProperties.getProperty(scheme + "." + PROXY_PORT), proxyProperties.getProperty(scheme + "." + PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (scheme.startsWith("http") || "ftp".equals(scheme) || scheme.startsWith("socks")){ Proxy proxy = getProxy("socks", proxyProperties.getProperty(SOCKS_PROXY_HOST), proxyProperties.getProperty(SOCKS_PROXY_PORT), proxyProperties.getProperty(SOCKS_PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (list.size() > 0) { return list; } return delegateSelect(uri); } JaxWsProxySelector(@Nullable ProxySelector proxySelector, Properties properties);  JaxWsProxySelector(@Nullable ProxySelector proxySelector); @Override List<Proxy> select(URI uri); @Override void connectFailed(URI uri, SocketAddress socketAddress, IOException ioException); }
JaxWsProxySelector extends ProxySelector { @Override public List<Proxy> select(URI uri) { List<Proxy> list = Lists.newArrayList(); if (uri == null) { throw new IllegalArgumentException("URI can't be null."); } String scheme = uri.getScheme().toLowerCase(); if (SUPPORTED_SCHEMES.contains(scheme)){ Proxy proxy = getProxy(scheme, proxyProperties.getProperty(scheme + "." + PROXY_HOST), proxyProperties.getProperty(scheme + "." + PROXY_PORT), proxyProperties.getProperty(scheme + "." + PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (scheme.startsWith("http") || "ftp".equals(scheme) || scheme.startsWith("socks")){ Proxy proxy = getProxy("socks", proxyProperties.getProperty(SOCKS_PROXY_HOST), proxyProperties.getProperty(SOCKS_PROXY_PORT), proxyProperties.getProperty(SOCKS_PROXY_USER)); if (proxy != null){ list.add(proxy); } } if (list.size() > 0) { return list; } return delegateSelect(uri); } JaxWsProxySelector(@Nullable ProxySelector proxySelector, Properties properties);  JaxWsProxySelector(@Nullable ProxySelector proxySelector); @Override List<Proxy> select(URI uri); @Override void connectFailed(URI uri, SocketAddress socketAddress, IOException ioException);  }