HttpHost proxyHost = new HttpHost(proxy.getHost(), proxy.getPort()); requestConfigBuilder.setProxy(proxyHost); if (proxy.hasCredentials()) { NTCredentials proxyCredentials = new NTCredentials(proxy.getCredentials().getUsername(), proxy.getCredentials().getPassword(), "", proxy.getCredentials().getDomain());
/** * Constructor for instantiating Exchange data source. * * @param settings the settings to use when reading from Microsoft Exchange * @throws Exception if an error occurs */ public ExchangeSourceImpl(final ExchangeSettings settings) throws Exception { LOG.info("Connecting to Exchange (" + settings.getExchangeHost() + ") as " + settings.getExchangeUsername() + "..."); final ExchangeCredentials credentials = new WebCredentials(settings.getExchangeUsername(), settings.getExchangePassword(), settings.getExchangeDomain()); service = new ExchangeService(ExchangeVersion.valueOf(settings.getExchangeVersion())); service.setCredentials(credentials); if (settings.needsExchangeProxy()) { final WebProxy webProxy = new WebProxy(settings.getExchangeProxyHost(), settings.getExchangeProxyPort()); service.setWebProxy(webProxy); } service.setUrl(new URI("https://" + settings.getExchangeHost() + "/EWS/Exchange.asmx")); service.setTraceEnabled(ENABLE_DEBUGGING); LOG.info("Connected to Exchange."); }
HttpHost proxyHost = new HttpHost(proxy.getHost(), proxy.getPort()); requestConfigBuilder.setProxy(proxyHost); if (proxy.hasCredentials()) { NTCredentials proxyCredentials = new NTCredentials(proxy.getCredentials().getUsername(), proxy.getCredentials().getPassword(), "", proxy.getCredentials().getDomain());