if (ok) {
Settings settings = ide.getSettings();
this.scraper = new Scraper(this.scraperConfiguration, settings.getWorkingPath());
this.scraper.addVariablesToContext(initParams);
if ( settings.isProxyEnabled() ) {
HttpClientManager httpClientManager = scraper.getHttpClientManager();
int proxyPort = settings.getProxyPort();
String proxyServer = settings.getProxyServer();
if (proxyPort > 0) {
httpClientManager.setHttpProxy(proxyServer, proxyPort);
} else {
httpClientManager.setHttpProxy(proxyServer);
}
if ( settings.isProxyAuthEnabled() ) {
String ntlmHost = settings.isNtlmAuthEnabled() ? settings.getNtlmHost() : null;
String ntlmDomain = settings.isNtlmAuthEnabled() ? settings.getNtlmDomain() : null;
httpClientManager.setHttpProxyCredentials(
settings.getProxyUserename(), settings.getProxyPassword(), ntlmHost, ntlmDomain
);
}
}