@Test public void getProxyHost_envVarSet_emptyUrl_doesNotThrow() { EnvironmentVariableHelper environmentVariableHelper = new EnvironmentVariableHelper(); environmentVariableHelper.set("https_proxy", ""); ClientConfiguration config = new ClientConfiguration(); assertNull(config.getProxyHost()); environmentVariableHelper.reset(); environmentVariableHelper.set("http_proxy", ""); config = new ClientConfiguration(); assertNull(config.getProxyHost()); environmentVariableHelper.reset(); }
public String getProxyHost() { if (proxyHost != null) { return proxyHost; } else if (getProxyHostProperty() != null) { return getProxyHostProperty(); } else { return getProxyHostEnvironment(); } }
ClientConfiguration { public String getProxyHost() { if (proxyHost != null) { return proxyHost; } else if (getProxyHostProperty() != null) { return getProxyHostProperty(); } else { return getProxyHostEnvironment(); } } }
ClientConfiguration { public String getProxyHost() { if (proxyHost != null) { return proxyHost; } else if (getProxyHostProperty() != null) { return getProxyHostProperty(); } else { return getProxyHostEnvironment(); } } ClientConfiguration();  ClientConfiguration(ClientConfiguration other); }
ClientConfiguration { public String getProxyHost() { if (proxyHost != null) { return proxyHost; } else if (getProxyHostProperty() != null) { return getProxyHostProperty(); } else { return getProxyHostEnvironment(); } } ClientConfiguration();  ClientConfiguration(ClientConfiguration other); Protocol getProtocol(); void setProtocol(Protocol protocol); ClientConfiguration withProtocol(Protocol protocol); int getMaxConnections(); void setMaxConnections(int maxConnections); ClientConfiguration withMaxConnections(int maxConnections); @Deprecated String getUserAgent(); @Deprecated void setUserAgent(String userAgent); @Deprecated ClientConfiguration withUserAgent(String userAgent); String getUserAgentPrefix(); void setUserAgentPrefix(String prefix); ClientConfiguration withUserAgentPrefix(String prefix); String getUserAgentSuffix(); void setUserAgentSuffix(String suffix); ClientConfiguration withUserAgentSuffix(String suffix); InetAddress getLocalAddress(); void setLocalAddress(InetAddress localAddress); ClientConfiguration withLocalAddress(InetAddress localAddress); Protocol getProxyProtocol(); ClientConfiguration withProxyProtocol(Protocol proxyProtocol); void setProxyProtocol(Protocol proxyProtocol); String getProxyHost(); void setProxyHost(String proxyHost); ClientConfiguration withProxyHost(String proxyHost); int getProxyPort(); void setProxyPort(int proxyPort); ClientConfiguration withProxyPort(int proxyPort); ClientConfiguration withDisableSocketProxy(boolean disableSocketProxy); void setDisableSocketProxy(boolean disableSocketProxy); boolean disableSocketProxy(); String getProxyUsername(); void setProxyUsername(String proxyUsername); ClientConfiguration withProxyUsername(String proxyUsername); String getProxyPassword(); void setProxyPassword(String proxyPassword); ClientConfiguration withProxyPassword(String proxyPassword); String getProxyDomain(); void setProxyDomain(String proxyDomain); ClientConfiguration withProxyDomain(String proxyDomain); String getProxyWorkstation(); void setProxyWorkstation(String proxyWorkstation); ClientConfiguration withProxyWorkstation(String proxyWorkstation); String getNonProxyHosts(); void setNonProxyHosts(String nonProxyHosts); ClientConfiguration withNonProxyHosts(String nonProxyHosts); List<ProxyAuthenticationMethod> getProxyAuthenticationMethods(); void setProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods); ClientConfiguration withProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods); RetryPolicy getRetryPolicy(); void setRetryPolicy(RetryPolicy retryPolicy); ClientConfiguration withRetryPolicy(RetryPolicy retryPolicy); int getMaxErrorRetry(); void setMaxErrorRetry(int maxErrorRetry); ClientConfiguration withMaxErrorRetry(int maxErrorRetry); ClientConfiguration withRetryMode(RetryMode retryMode); void setRetryMode(RetryMode retryMode); RetryMode getRetryMode(); int getSocketTimeout(); void setSocketTimeout(int socketTimeout); ClientConfiguration withSocketTimeout(int socketTimeout); int getConnectionTimeout(); void setConnectionTimeout(int connectionTimeout); ClientConfiguration withConnectionTimeout(int connectionTimeout); int getRequestTimeout(); void setRequestTimeout(int requestTimeout); ClientConfiguration withRequestTimeout(int requestTimeout); int getClientExecutionTimeout(); void setClientExecutionTimeout(int clientExecutionTimeout); ClientConfiguration withClientExecutionTimeout(int clientExecutionTimeout); boolean useReaper(); void setUseReaper(boolean use); ClientConfiguration withReaper(boolean use); boolean useThrottledRetries(); void setUseThrottleRetries(boolean use); ClientConfiguration withThrottledRetries(boolean use); void setMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling); ClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling); int getMaxConsecutiveRetriesBeforeThrottling(); boolean useGzip(); void setUseGzip(boolean use); ClientConfiguration withGzip(boolean use); int[] getSocketBufferSizeHints(); void setSocketBufferSizeHints(int socketSendBufferSizeHint, int socketReceiveBufferSizeHint); ClientConfiguration withSocketBufferSizeHints(int socketSendBufferSizeHint,
                                                         int socketReceiveBufferSizeHint); String getSignerOverride(); void setSignerOverride(final String value); ClientConfiguration withSignerOverride(final String value); boolean isPreemptiveBasicProxyAuth(); void setPreemptiveBasicProxyAuth(Boolean preemptiveBasicProxyAuth); ClientConfiguration withPreemptiveBasicProxyAuth(boolean preemptiveBasicProxyAuth); long getConnectionTTL(); void setConnectionTTL(long connectionTTL); ClientConfiguration withConnectionTTL(long connectionTTL); long getConnectionMaxIdleMillis(); void setConnectionMaxIdleMillis(long connectionMaxIdleMillis); ClientConfiguration withConnectionMaxIdleMillis(long connectionMaxIdleMillis); int getValidateAfterInactivityMillis(); void setValidateAfterInactivityMillis(int validateAfterInactivityMillis); ClientConfiguration withValidateAfterInactivityMillis(int validateAfterInactivityMillis); boolean useTcpKeepAlive(); void setUseTcpKeepAlive(final boolean use); ClientConfiguration withTcpKeepAlive(final boolean use); DnsResolver getDnsResolver(); void setDnsResolver(final DnsResolver resolver); ClientConfiguration withDnsResolver(final DnsResolver resolver); boolean getCacheResponseMetadata(); void setCacheResponseMetadata(boolean shouldCache); ClientConfiguration withCacheResponseMetadata(final boolean shouldCache); int getResponseMetadataCacheSize(); void setResponseMetadataCacheSize(int responseMetadataCacheSize); ClientConfiguration withResponseMetadataCacheSize(int responseMetadataCacheSize); ApacheHttpClientConfig getApacheHttpClientConfig(); SecureRandom getSecureRandom(); void setSecureRandom(SecureRandom secureRandom); ClientConfiguration withSecureRandom(SecureRandom secureRandom); boolean isUseExpectContinue(); void setUseExpectContinue(boolean useExpectContinue); ClientConfiguration withUseExpectContinue(boolean useExpectContinue); ClientConfiguration withHeader(String name, String value); void addHeader(String name, String value); Map<String, String> getHeaders(); boolean isDisableHostPrefixInjection(); void setDisableHostPrefixInjection(boolean disableHostPrefixInjection); ClientConfiguration withDisableHostPrefixInjection(boolean disableHostPrefixInjection); TlsKeyManagersProvider getTlsKeyManagersProvider(); ClientConfiguration withTlsKeyManagersProvider(TlsKeyManagersProvider tlsKeyManagersProvider); void setTlsKeyManagersProvider(TlsKeyManagersProvider tlsKeyManagersProvider); }
ClientConfiguration { public String getProxyHost() { if (proxyHost != null) { return proxyHost; } else if (getProxyHostProperty() != null) { return getProxyHostProperty(); } else { return getProxyHostEnvironment(); } } ClientConfiguration();  ClientConfiguration(ClientConfiguration other); Protocol getProtocol(); void setProtocol(Protocol protocol); ClientConfiguration withProtocol(Protocol protocol); int getMaxConnections(); void setMaxConnections(int maxConnections); ClientConfiguration withMaxConnections(int maxConnections); @Deprecated String getUserAgent(); @Deprecated void setUserAgent(String userAgent); @Deprecated ClientConfiguration withUserAgent(String userAgent); String getUserAgentPrefix(); void setUserAgentPrefix(String prefix); ClientConfiguration withUserAgentPrefix(String prefix); String getUserAgentSuffix(); void setUserAgentSuffix(String suffix); ClientConfiguration withUserAgentSuffix(String suffix); InetAddress getLocalAddress(); void setLocalAddress(InetAddress localAddress); ClientConfiguration withLocalAddress(InetAddress localAddress); Protocol getProxyProtocol(); ClientConfiguration withProxyProtocol(Protocol proxyProtocol); void setProxyProtocol(Protocol proxyProtocol); String getProxyHost(); void setProxyHost(String proxyHost); ClientConfiguration withProxyHost(String proxyHost); int getProxyPort(); void setProxyPort(int proxyPort); ClientConfiguration withProxyPort(int proxyPort); ClientConfiguration withDisableSocketProxy(boolean disableSocketProxy); void setDisableSocketProxy(boolean disableSocketProxy); boolean disableSocketProxy(); String getProxyUsername(); void setProxyUsername(String proxyUsername); ClientConfiguration withProxyUsername(String proxyUsername); String getProxyPassword(); void setProxyPassword(String proxyPassword); ClientConfiguration withProxyPassword(String proxyPassword); String getProxyDomain(); void setProxyDomain(String proxyDomain); ClientConfiguration withProxyDomain(String proxyDomain); String getProxyWorkstation(); void setProxyWorkstation(String proxyWorkstation); ClientConfiguration withProxyWorkstation(String proxyWorkstation); String getNonProxyHosts(); void setNonProxyHosts(String nonProxyHosts); ClientConfiguration withNonProxyHosts(String nonProxyHosts); List<ProxyAuthenticationMethod> getProxyAuthenticationMethods(); void setProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods); ClientConfiguration withProxyAuthenticationMethods(List<ProxyAuthenticationMethod> proxyAuthenticationMethods); RetryPolicy getRetryPolicy(); void setRetryPolicy(RetryPolicy retryPolicy); ClientConfiguration withRetryPolicy(RetryPolicy retryPolicy); int getMaxErrorRetry(); void setMaxErrorRetry(int maxErrorRetry); ClientConfiguration withMaxErrorRetry(int maxErrorRetry); ClientConfiguration withRetryMode(RetryMode retryMode); void setRetryMode(RetryMode retryMode); RetryMode getRetryMode(); int getSocketTimeout(); void setSocketTimeout(int socketTimeout); ClientConfiguration withSocketTimeout(int socketTimeout); int getConnectionTimeout(); void setConnectionTimeout(int connectionTimeout); ClientConfiguration withConnectionTimeout(int connectionTimeout); int getRequestTimeout(); void setRequestTimeout(int requestTimeout); ClientConfiguration withRequestTimeout(int requestTimeout); int getClientExecutionTimeout(); void setClientExecutionTimeout(int clientExecutionTimeout); ClientConfiguration withClientExecutionTimeout(int clientExecutionTimeout); boolean useReaper(); void setUseReaper(boolean use); ClientConfiguration withReaper(boolean use); boolean useThrottledRetries(); void setUseThrottleRetries(boolean use); ClientConfiguration withThrottledRetries(boolean use); void setMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling); ClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling); int getMaxConsecutiveRetriesBeforeThrottling(); boolean useGzip(); void setUseGzip(boolean use); ClientConfiguration withGzip(boolean use); int[] getSocketBufferSizeHints(); void setSocketBufferSizeHints(int socketSendBufferSizeHint, int socketReceiveBufferSizeHint); ClientConfiguration withSocketBufferSizeHints(int socketSendBufferSizeHint,
                                                         int socketReceiveBufferSizeHint); String getSignerOverride(); void setSignerOverride(final String value); ClientConfiguration withSignerOverride(final String value); boolean isPreemptiveBasicProxyAuth(); void setPreemptiveBasicProxyAuth(Boolean preemptiveBasicProxyAuth); ClientConfiguration withPreemptiveBasicProxyAuth(boolean preemptiveBasicProxyAuth); long getConnectionTTL(); void setConnectionTTL(long connectionTTL); ClientConfiguration withConnectionTTL(long connectionTTL); long getConnectionMaxIdleMillis(); void setConnectionMaxIdleMillis(long connectionMaxIdleMillis); ClientConfiguration withConnectionMaxIdleMillis(long connectionMaxIdleMillis); int getValidateAfterInactivityMillis(); void setValidateAfterInactivityMillis(int validateAfterInactivityMillis); ClientConfiguration withValidateAfterInactivityMillis(int validateAfterInactivityMillis); boolean useTcpKeepAlive(); void setUseTcpKeepAlive(final boolean use); ClientConfiguration withTcpKeepAlive(final boolean use); DnsResolver getDnsResolver(); void setDnsResolver(final DnsResolver resolver); ClientConfiguration withDnsResolver(final DnsResolver resolver); boolean getCacheResponseMetadata(); void setCacheResponseMetadata(boolean shouldCache); ClientConfiguration withCacheResponseMetadata(final boolean shouldCache); int getResponseMetadataCacheSize(); void setResponseMetadataCacheSize(int responseMetadataCacheSize); ClientConfiguration withResponseMetadataCacheSize(int responseMetadataCacheSize); ApacheHttpClientConfig getApacheHttpClientConfig(); SecureRandom getSecureRandom(); void setSecureRandom(SecureRandom secureRandom); ClientConfiguration withSecureRandom(SecureRandom secureRandom); boolean isUseExpectContinue(); void setUseExpectContinue(boolean useExpectContinue); ClientConfiguration withUseExpectContinue(boolean useExpectContinue); ClientConfiguration withHeader(String name, String value); void addHeader(String name, String value); Map<String, String> getHeaders(); boolean isDisableHostPrefixInjection(); void setDisableHostPrefixInjection(boolean disableHostPrefixInjection); ClientConfiguration withDisableHostPrefixInjection(boolean disableHostPrefixInjection); TlsKeyManagersProvider getTlsKeyManagersProvider(); ClientConfiguration withTlsKeyManagersProvider(TlsKeyManagersProvider tlsKeyManagersProvider); void setTlsKeyManagersProvider(TlsKeyManagersProvider tlsKeyManagersProvider); static final int DEFAULT_CONNECTION_TIMEOUT; static final int DEFAULT_SOCKET_TIMEOUT; static final int DEFAULT_REQUEST_TIMEOUT; static final int DEFAULT_CLIENT_EXECUTION_TIMEOUT; static final boolean DEFAULT_DISABLE_SOCKET_PROXY; static final int DEFAULT_MAX_CONNECTIONS; static final boolean DEFAULT_USE_EXPECT_CONTINUE; static final String DEFAULT_USER_AGENT; static final RetryPolicy DEFAULT_RETRY_POLICY; static final boolean DEFAULT_USE_REAPER; static final boolean DEFAULT_USE_GZIP; static final long DEFAULT_CONNECTION_TTL; static final long DEFAULT_CONNECTION_MAX_IDLE_MILLIS; static final int DEFAULT_VALIDATE_AFTER_INACTIVITY_MILLIS; static final boolean DEFAULT_TCP_KEEP_ALIVE; static final boolean DEFAULT_THROTTLE_RETRIES; static final boolean DEFAULT_CACHE_RESPONSE_METADATA; static final int DEFAULT_RESPONSE_METADATA_CACHE_SIZE; static final int DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING; }