public URLConnectionHandler findMatchingHandler(URL url) throws Exception { for (URLConnectionHandler urlh : getURLConnectionHandlers()) { if (urlh.matches(url)) { logger.debug("Decorate {} with handler {}", url, urlh); return urlh; } else logger.debug("No match for {}, handler {}", url, urlh); } return null; }
public URLConnectionHandler findMatchingHandler(URL url) throws Exception { for (URLConnectionHandler urlh : getURLConnectionHandlers()) { if (urlh.matches(url)) { logger.debug("Decorate {} with handler {}", url, urlh); return urlh; } else logger.debug("No match for {}, handler {}", url, urlh); } return null; }
@Override public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }
private URLConnection getProxiedAndConfiguredConnection(URL url, ProxySetup proxy) throws IOException, Exception { final URLConnection urlc = proxy != null ? url.openConnection(proxy.proxy) : url.openConnection(); URLConnectionHandler matching = findMatchingHandler(url); if (matching == null) return urlc; matching.handle(urlc); return urlc; }
public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }
private URLConnection getProxiedAndConfiguredConnection(URL url, ProxySetup proxy) throws IOException, Exception { final URLConnection urlc = proxy != null ? url.openConnection(proxy.proxy) : url.openConnection(); URLConnectionHandler matching = findMatchingHandler(url); if (matching == null) return urlc; matching.handle(urlc); return urlc; }
public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }
@Override public void handle(URLConnection connection) throws Exception { for (URLConnectionHandler h : registry.getPlugins(URLConnectionHandler.class)) { h.handle(connection); } }