/** * Setup the HTTP proxy. * Displays the logging on STDOUT. * * @throws ProxyConfigurationNotFound if the proxy.properties file is not found */ public static void setup( ) throws ProxyConfigurationNotFound { setup(System.out); }
/** * Setup the HTTP proxy. * * @param out where to display logging messages. <code>null</code> if you don't want any. * @throws ProxyConfigurationNotFound if the proxy.properties file is not found */ public static void setup( PrintStream out ) throws ProxyConfigurationNotFound { loadProxyProperties(); String proxyEnable = proxyProperties.getProperty("proxy.enable", "false"); if ( proxyEnable.equalsIgnoreCase("true") ) { String hostname = proxyProperties.getProperty( "proxy.host" ); String port = proxyProperties.getProperty( "proxy.port" ); System.setProperty( "http.proxySet", "true" ); System.setProperty( "http.proxyHost", hostname ); System.setProperty( "http.proxyPort", port ); if (out != null) out.println ( "Using HTTP proxy setting: " ); if (out != null) out.println ( "hostname: " + hostname ); if (out != null) out.println ( "port: " + port ); } else { System.setProperty( "http.proxySet", "false" ); if (out != null) out.println ( "No proxy setting requested." ); } }
/** * Setup the HTTP proxy. * * @param out where to display logging messages. <code>null</code> if you don't want any. * @throws ProxyConfigurationNotFound if the proxy.properties file is not found */ public static void setup( PrintStream out ) throws ProxyConfigurationNotFound { loadProxyProperties(); String proxyEnable = proxyProperties.getProperty("proxy.enable", "false"); if ( proxyEnable.equalsIgnoreCase("true") ) { String hostname = proxyProperties.getProperty( "proxy.host" ); String port = proxyProperties.getProperty( "proxy.port" ); System.setProperty( "http.proxySet", "true" ); System.setProperty( "http.proxyHost", hostname ); System.setProperty( "http.proxyPort", port ); if (out != null) out.println ( "Using HTTP proxy setting: " ); if (out != null) out.println ( "hostname: " + hostname ); if (out != null) out.println ( "port: " + port ); } else { System.setProperty( "http.proxySet", "false" ); if (out != null) out.println ( "No proxy setting requested." ); } }
/** * Setup the HTTP proxy. * Displays the logging on STDOUT. * * @throws ProxyConfigurationNotFound if the proxy.properties file is not found */ public static void setup( ) throws ProxyConfigurationNotFound { setup(System.out); }