/* (non-Javadoc) * @see com.salesforce.ide.model.IProxy#getProxyPassword() */ public String getProxyPassword() { if (!isProxiesEnabled()) { return Constants.EMPTY_STRING; } IProxyData httpProxyData = getHttpProxyData(); if (httpProxyData == null) { return Constants.EMPTY_STRING; } if (!httpProxyData.isRequiresAuthentication()) { return Constants.EMPTY_STRING; } if (Utils.isNotEmpty(httpProxyData.getPassword())) { if (logger.isDebugEnabled()) { logger.debug("Returning '***' as proxy password "); } return httpProxyData.getPassword(); } else { if (logger.isDebugEnabled()) { logger.debug("Returning blank/null proxy password "); } return Constants.EMPTY_STRING; } }
/* * @see * org.rssowl.core.connection.auth.ICredentialsProvider#getProxyCredentials * (java.net.URI) */ public IProxyCredentials getProxyCredentials(URI link) { Activator activator = Activator.getDefault(); /* Check if Bundle is Stopped */ if (activator == null) return null; IProxyService proxyService = activator.getProxyService(); /* Check if Proxy is enabled */ if (!proxyService.isProxiesEnabled()) return null; String host = URIUtils.safeGetHost(link); boolean isSSL = URIUtils.HTTPS_SCHEME.equals(link.getScheme()); /* Retrieve Proxy Data */ final IProxyData proxyData = proxyService.getProxyDataForHost( host, isSSL ? IProxyData.HTTPS_PROXY_TYPE : IProxyData.HTTP_PROXY_TYPE); if (proxyData != null) { /* Look for Domain as part of Username to support NTLM Proxy */ final String proxyHost = proxyData.getHost(); final int proxyPort = proxyData.getPort(); final Pair<String /* Username */, String /* Domain */> proxyUserAndDomain = splitUserAndDomain(proxyData.getUserId()); final String proxyPassword = proxyData.getPassword(); /* Return as IProxyCredentials Object */ return new IProxyCredentials() { public String getHost() { return proxyHost; } public int getPort() { return proxyPort; } public String getUsername() { return proxyUserAndDomain.getFirst(); } public String getPassword() { return proxyPassword; } public String getDomain() { return proxyUserAndDomain.getSecond(); } }; } /* Feed does not require Proxy or Credentials not supplied */ return null; }