// For backward compatibility, provide // programmatic access for setting proxy info // Extract proxy info from command line -D parameters // extended 5/7/2012 to get NTLM domain // H/T: [email protected] static void getGlobalProxyD() { Proxy proxy = new Proxy(); String host = System.getProperty("http.proxyHost"); String port = System.getProperty("http.proxyPort"); int portno = -1; if (host != null) { host = host.trim(); if (host.length() == 0) host = null; } if (port != null) { port = port.trim(); if (port.length() > 0) { try { portno = Integer.parseInt(port); } catch (NumberFormatException nfe) { portno = -1; } } } if (host != null) { proxy.host = host; proxy.port = portno; globalproxy = proxy; } }
static String getpassword(String prefix) { String password = System.getProperty(prefix + "storepassword"); if (password != null) { password = password.trim(); if (password.length() == 0) password = null; } return password; }
static String cleanproperty(String property) { String value = System.getProperty(property); if (value != null) { value = value.trim(); if (value.length() == 0) value = null; } return value; }
static String getstorepath(String prefix) { String path = System.getProperty(prefix + "store"); if (path != null) { path = path.trim(); if (path.length() == 0) path = null; } return path; }