@Test public void buildNoProxyRoute() throws URISyntaxException, HttpException { RequestConfig reqConfig = requestConfigBuilder .buildRequestConfig(); assertNotNull(reqConfig); assertTrue(reqConfig.isRedirectsEnabled()); assertEquals("0", String.valueOf(reqConfig.getConnectTimeout())); assertEquals("0", String.valueOf(reqConfig.getSocketTimeout())); assertNull(reqConfig.getProxy()); }
public RequestConfig buildRequestConfig() { HttpHost proxy = null; final int proxyPortNumber; if (proxyHost != null && !proxyHost.isEmpty()) { proxyPortNumber = Utils.validatePortNumber(proxyPort); proxy = new HttpHost(proxyHost, proxyPortNumber); } int connectionTimeout = Integer.parseInt(this.connectionTimeout); int socketTimeout = Integer.parseInt(this.socketTimeout); return RequestConfig.custom() .setConnectTimeout(connectionTimeout <= 0 ? connectionTimeout : connectionTimeout * 1000) .setSocketTimeout(socketTimeout <= 0 ? socketTimeout : socketTimeout * 1000) .setProxy(proxy) .setRedirectsEnabled(Boolean.parseBoolean(followRedirects)).build(); }
RequestConfigBuilder { public RequestConfig buildRequestConfig() { HttpHost proxy = null; final int proxyPortNumber; if (proxyHost != null && !proxyHost.isEmpty()) { proxyPortNumber = Utils.validatePortNumber(proxyPort); proxy = new HttpHost(proxyHost, proxyPortNumber); } int connectionTimeout = Integer.parseInt(this.connectionTimeout); int socketTimeout = Integer.parseInt(this.socketTimeout); return RequestConfig.custom() .setConnectTimeout(connectionTimeout <= 0 ? connectionTimeout : connectionTimeout * 1000) .setSocketTimeout(socketTimeout <= 0 ? socketTimeout : socketTimeout * 1000) .setProxy(proxy) .setRedirectsEnabled(Boolean.parseBoolean(followRedirects)).build(); } }
RequestConfigBuilder { public RequestConfig buildRequestConfig() { HttpHost proxy = null; final int proxyPortNumber; if (proxyHost != null && !proxyHost.isEmpty()) { proxyPortNumber = Utils.validatePortNumber(proxyPort); proxy = new HttpHost(proxyHost, proxyPortNumber); } int connectionTimeout = Integer.parseInt(this.connectionTimeout); int socketTimeout = Integer.parseInt(this.socketTimeout); return RequestConfig.custom() .setConnectTimeout(connectionTimeout <= 0 ? connectionTimeout : connectionTimeout * 1000) .setSocketTimeout(socketTimeout <= 0 ? socketTimeout : socketTimeout * 1000) .setProxy(proxy) .setRedirectsEnabled(Boolean.parseBoolean(followRedirects)).build(); }  }
RequestConfigBuilder { public RequestConfig buildRequestConfig() { HttpHost proxy = null; final int proxyPortNumber; if (proxyHost != null && !proxyHost.isEmpty()) { proxyPortNumber = Utils.validatePortNumber(proxyPort); proxy = new HttpHost(proxyHost, proxyPortNumber); } int connectionTimeout = Integer.parseInt(this.connectionTimeout); int socketTimeout = Integer.parseInt(this.socketTimeout); return RequestConfig.custom() .setConnectTimeout(connectionTimeout <= 0 ? connectionTimeout : connectionTimeout * 1000) .setSocketTimeout(socketTimeout <= 0 ? socketTimeout : socketTimeout * 1000) .setProxy(proxy) .setRedirectsEnabled(Boolean.parseBoolean(followRedirects)).build(); }  RequestConfigBuilder setConnectionTimeout(String connectionTimeout); RequestConfigBuilder setSocketTimeout(String socketTimeout); RequestConfigBuilder setFollowRedirects(String followRedirects); RequestConfigBuilder setProxyHost(String proxyHost); RequestConfigBuilder setProxyPort(String proxyPort); RequestConfig buildRequestConfig(); }
RequestConfigBuilder { public RequestConfig buildRequestConfig() { HttpHost proxy = null; final int proxyPortNumber; if (proxyHost != null && !proxyHost.isEmpty()) { proxyPortNumber = Utils.validatePortNumber(proxyPort); proxy = new HttpHost(proxyHost, proxyPortNumber); } int connectionTimeout = Integer.parseInt(this.connectionTimeout); int socketTimeout = Integer.parseInt(this.socketTimeout); return RequestConfig.custom() .setConnectTimeout(connectionTimeout <= 0 ? connectionTimeout : connectionTimeout * 1000) .setSocketTimeout(socketTimeout <= 0 ? socketTimeout : socketTimeout * 1000) .setProxy(proxy) .setRedirectsEnabled(Boolean.parseBoolean(followRedirects)).build(); }  RequestConfigBuilder setConnectionTimeout(String connectionTimeout); RequestConfigBuilder setSocketTimeout(String socketTimeout); RequestConfigBuilder setFollowRedirects(String followRedirects); RequestConfigBuilder setProxyHost(String proxyHost); RequestConfigBuilder setProxyPort(String proxyPort); RequestConfig buildRequestConfig();  }