public String getUserName() { // if (url != null && url.getUserInfo() != null) { // return url.getUserInfo(); // } Map properties = getHostProperties(); String userName = (String) properties.get("username"); return userName; }
private String getStorePlainTextPasswordOption() { Map properties = getHostProperties(); return (String) properties.get("store-plaintext-passwords"); }
private String getAuthStorageEnabledOption() { Map properties = getHostProperties(); return (String) properties.get("store-auth-creds"); }
private String getStorePlainTextPassphraseOption() { Map properties = getHostProperties(); return (String) properties.get("store-ssl-client-cert-pp-plaintext"); }
public String getSSLClientCertFile() { Map properties = getHostProperties(); return (String) properties.get("ssl-client-cert-file"); }
public String getSSLClientCertPassword() { Map properties = getHostProperties(); return (String) properties.get("ssl-client-cert-password"); }
public boolean trustDefaultSSLCertificateAuthority() { Map properties = getHostProperties(); return !"no".equalsIgnoreCase((String) properties.get("ssl-trust-default-ca")); }
public boolean isStoreSSLClientCertificatePassphrases() { Map properties = getHostProperties(); String storeCertPassphrases = (String) properties.get("store-ssl-client-cert-pp"); if (storeCertPassphrases == null) { return true; } return "yes".equalsIgnoreCase(storeCertPassphrases) || "on".equalsIgnoreCase(storeCertPassphrases) || "true".equalsIgnoreCase(storeCertPassphrases); }
public boolean isStorePasswords() { boolean store = true; // String value = getConfigFile().getPropertyValue("auth", "store-passwords"); // if (value != null) { // store = "yes".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value); // } Map properties = getHostProperties(); String storePasswords = (String) properties.get("store-passwords"); if (storePasswords == null) { return store; } return "yes".equalsIgnoreCase(storePasswords) || "on".equalsIgnoreCase(storePasswords) || "true".equalsIgnoreCase(storePasswords); }
public Collection getAuthTypes() { List schemes = new ArrayList(); Map hostProperties = getHostProperties(); String authTypes = (String) hostProperties.get("http-auth-types"); if (authTypes == null || "".equals(authTypes.trim())) { return schemes; } for (StringTokenizer tokens = new StringTokenizer(authTypes, ";"); tokens.hasMoreTokens();) { String scheme = tokens.nextToken(); if (!schemes.contains(scheme)) { schemes.add(scheme); } } return schemes; }
public File[] getSSLAuthorityFiles() { Map properties = getHostProperties(); String sslAuthorityFilePaths = (String) properties.get("ssl-authority-files"); // "pem" files Collection trustStorages = new ArrayList(); if (sslAuthorityFilePaths != null) { for (StringTokenizer files = new StringTokenizer(sslAuthorityFilePaths, ";"); files.hasMoreTokens();) { String fileName = files.nextToken(); fileName = fileName == null ? null : fileName.trim(); if (fileName != null && !"".equals(fileName)) { trustStorages.add(new File(fileName)); } } } return (File[]) trustStorages.toArray(new File[trustStorages.size()]); }
public int getReadTimeout() { String protocol = getProtocol(); if ("http".equals(protocol) || "https".equals(protocol)) { Map properties = getHostProperties(); String timeout = (String) properties.get("http-timeout"); if (timeout != null) { try { return Integer.parseInt(timeout) * 1000; } catch (NumberFormatException nfe) { } } return 3600 * 1000; } return 0; }
private String getProxyOption(String optionName, String systemProperty) { String host = getHost(); Map properties = getHostProperties(); String value = (String) properties.get(optionName); if ((value == null || "".equals(value.trim())) && systemProperty != null) { value = System.getProperty(systemProperty); } if (value == null || "".equals(value.trim())) { return null; } if (hostExceptedFromProxy(host, properties)) { return null; } return value; }