@Test public void testExcludedLocalHost() { final SystemConfigurationProxy proxy = new SystemConfigurationProxy(); assertEquals(Proxy.Type.DIRECT, proxy.find(new Host(new TestProtocol(), "cyberduck.local")).getType()); }
@Override public Proxy find(final Host target) { if(!preferences.getBoolean("connection.proxy.enable")) { return Proxy.DIRECT; } final String route = this.findNative(provider.get(target)); if(null == route) { if(log.isInfoEnabled()) { log.info(String.format("No proxy configuration found for target %s", target)); } return Proxy.DIRECT; } final URI proxy; try { proxy = new URI(route); try { return new Proxy(Proxy.Type.valueOf(StringUtils.upperCase(proxy.getScheme())), proxy.getHost(), proxy.getPort()); } catch(IllegalArgumentException e) { log.warn(String.format("Unsupported scheme for proxy %s", proxy)); } } catch(URISyntaxException e) { log.warn(String.format("Invalid proxy configuration %s", route)); } return Proxy.DIRECT; }
SystemConfigurationProxy extends AbstractProxyFinder implements ProxyFinder { @Override public Proxy find(final Host target) { if(!preferences.getBoolean("connection.proxy.enable")) { return Proxy.DIRECT; } final String route = this.findNative(provider.get(target)); if(null == route) { if(log.isInfoEnabled()) { log.info(String.format("No proxy configuration found for target %s", target)); } return Proxy.DIRECT; } final URI proxy; try { proxy = new URI(route); try { return new Proxy(Proxy.Type.valueOf(StringUtils.upperCase(proxy.getScheme())), proxy.getHost(), proxy.getPort()); } catch(IllegalArgumentException e) { log.warn(String.format("Unsupported scheme for proxy %s", proxy)); } } catch(URISyntaxException e) { log.warn(String.format("Invalid proxy configuration %s", route)); } return Proxy.DIRECT; } }
SystemConfigurationProxy extends AbstractProxyFinder implements ProxyFinder { @Override public Proxy find(final Host target) { if(!preferences.getBoolean("connection.proxy.enable")) { return Proxy.DIRECT; } final String route = this.findNative(provider.get(target)); if(null == route) { if(log.isInfoEnabled()) { log.info(String.format("No proxy configuration found for target %s", target)); } return Proxy.DIRECT; } final URI proxy; try { proxy = new URI(route); try { return new Proxy(Proxy.Type.valueOf(StringUtils.upperCase(proxy.getScheme())), proxy.getHost(), proxy.getPort()); } catch(IllegalArgumentException e) { log.warn(String.format("Unsupported scheme for proxy %s", proxy)); } } catch(URISyntaxException e) { log.warn(String.format("Invalid proxy configuration %s", route)); } return Proxy.DIRECT; }  }
SystemConfigurationProxy extends AbstractProxyFinder implements ProxyFinder { @Override public Proxy find(final Host target) { if(!preferences.getBoolean("connection.proxy.enable")) { return Proxy.DIRECT; } final String route = this.findNative(provider.get(target)); if(null == route) { if(log.isInfoEnabled()) { log.info(String.format("No proxy configuration found for target %s", target)); } return Proxy.DIRECT; } final URI proxy; try { proxy = new URI(route); try { return new Proxy(Proxy.Type.valueOf(StringUtils.upperCase(proxy.getScheme())), proxy.getHost(), proxy.getPort()); } catch(IllegalArgumentException e) { log.warn(String.format("Unsupported scheme for proxy %s", proxy)); } } catch(URISyntaxException e) { log.warn(String.format("Invalid proxy configuration %s", route)); } return Proxy.DIRECT; }  @Override Proxy find(final Host target); native String findNative(String target); }
SystemConfigurationProxy extends AbstractProxyFinder implements ProxyFinder { @Override public Proxy find(final Host target) { if(!preferences.getBoolean("connection.proxy.enable")) { return Proxy.DIRECT; } final String route = this.findNative(provider.get(target)); if(null == route) { if(log.isInfoEnabled()) { log.info(String.format("No proxy configuration found for target %s", target)); } return Proxy.DIRECT; } final URI proxy; try { proxy = new URI(route); try { return new Proxy(Proxy.Type.valueOf(StringUtils.upperCase(proxy.getScheme())), proxy.getHost(), proxy.getPort()); } catch(IllegalArgumentException e) { log.warn(String.format("Unsupported scheme for proxy %s", proxy)); } } catch(URISyntaxException e) { log.warn(String.format("Invalid proxy configuration %s", route)); } return Proxy.DIRECT; }  @Override Proxy find(final Host target); native String findNative(String target);  }