Package org.webharvest.runtime.web

Examples of org.webharvest.runtime.web.HttpClientManager


    public Scraper(ScraperConfiguration configuration, String workingDir) {
        this.configuration = configuration;
        this.runtimeConfig = new RuntimeConfig();
        this.workingDir = CommonUtil.adaptFilename(workingDir);

        this.httpClientManager = new HttpClientManager();

        this.context = new ScraperContext(this);
        this.scriptEngine = configuration.createScriptEngine(this.context);
        this.usedScriptEngines.put(configuration.getDefaultScriptEngine(), this.scriptEngine);
    }
View Full Code Here


            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
                        );
                    }
                }
View Full Code Here

TOP

Related Classes of org.webharvest.runtime.web.HttpClientManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.