public static HttpURLConnection getConnection(URL url, Proxy proxy) throws IOException { Log.debug("Opening Connection With: {{" + url + "}}"); HttpURLConnection connection; if (proxy == null) connection = (HttpURLConnection) url.openConnection(); else { connection = (HttpURLConnection) proxy.getConnection(url); } setConfiguration(connection); return connection; }