ProxySelector (String pacUrlForUse) { ProxySelector newProxySelector; if (pacUrlForUse == null) { ProxySearch proxySearch = ProxySearch.getDefaultProxySearch(); // cache 32 urls for up to 10 min proxySearch.setPacCacheSettings(32, 10 * 60 * 1000, BufferedProxySelector.CacheScope.CACHE_SCOPE_HOST); newProxySelector = proxySearch.getProxySelector(); } else { newProxySelector = new PacProxySelector(new UrlPacScriptSource(pacUrlForUse)); } return newProxySelector; }