Package com.helger.httpclient
Class HttpProxySettings
java.lang.Object
com.helger.httpclient.HttpProxySettings
- All Implemented Interfaces:
com.helger.base.clone.ICloneable<HttpProxySettings>,IHttpProxySettings
@NotThreadSafe
public class HttpProxySettings
extends Object
implements IHttpProxySettings, com.helger.base.clone.ICloneable<HttpProxySettings>
All the easily configurable settings for a single HTTP proxy server
- Since:
- 10.5.0
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.HttpProxySettings(IHttpProxySettings aSource) "Copy" constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal HttpProxySettingsaddNonProxyHostsFromPipeString(String sDefinition) Add all non-proxy hosts from a piped string as in127.0.0.1 | localhost.getClone()final org.apache.hc.client5.http.auth.Credentialsfinal org.apache.hc.core5.http.HttpHostfinal com.helger.collection.commons.ICommonsOrderedSet<String> final HttpProxySettingssetAllFrom(IHttpProxySettings aSource) Apply all settings from the provided HTTP proxy settingsfinal HttpProxySettingssetNonProxyHostsFromPipeString(String sDefinition) Set all non-proxy hosts from a piped string as in127.0.0.1 | localhost.final HttpProxySettingssetProxyCredentials(org.apache.hc.client5.http.auth.Credentials aProxyCredentials) Set proxy credentials.final HttpProxySettingssetProxyHost(org.apache.hc.core5.http.HttpHost aProxyHost) Set a proxy host without proxy server credentials.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.httpclient.IHttpProxySettings
getAllNonProxyHosts, hasProxyCredentials, hasProxyHost
-
Constructor Details
-
HttpProxySettings
public HttpProxySettings()Default constructor. -
HttpProxySettings
"Copy" constructor.- Parameters:
aSource- The source settings to copy from. May not benull.
-
-
Method Details
-
setAllFrom
Apply all settings from the provided HTTP proxy settings- Parameters:
aSource- The source settings to copy from. May not benull.- Returns:
- this for chaining.
-
getProxyHost
@Nullable public final org.apache.hc.core5.http.HttpHost getProxyHost()- Specified by:
getProxyHostin interfaceIHttpProxySettings- Returns:
- The proxy host to be used. May be
null.
-
setProxyHost
@Nonnull public final HttpProxySettings setProxyHost(@Nullable org.apache.hc.core5.http.HttpHost aProxyHost) Set a proxy host without proxy server credentials.- Parameters:
aProxyHost- The proxy host to be used. May benull.- Returns:
- this for chaining
- See Also:
-
getProxyCredentials
@Nullable public final org.apache.hc.client5.http.auth.Credentials getProxyCredentials()- Specified by:
getProxyCredentialsin interfaceIHttpProxySettings- Returns:
- The proxy server credentials to be used. May be
null.
-
setProxyCredentials
@Nonnull public final HttpProxySettings setProxyCredentials(@Nullable org.apache.hc.client5.http.auth.Credentials aProxyCredentials) Set proxy credentials.- Parameters:
aProxyCredentials- The proxy server credentials to be used. May benull. They are only used if a proxy host is present! Usually they are of typeUsernamePasswordCredentials.- Returns:
- this for chaining
- See Also:
-
nonProxyHosts
@Nonnull @ReturnsMutableObject public final com.helger.collection.commons.ICommonsOrderedSet<String> nonProxyHosts()- Specified by:
nonProxyHostsin interfaceIHttpProxySettings- Returns:
- The set of all host names and IP addresses for which no proxy should be used. Never
nulland mutable.
-
addNonProxyHostsFromPipeString
@Nonnull public final HttpProxySettings addNonProxyHostsFromPipeString(@Nullable String sDefinition) Add all non-proxy hosts from a piped string as in127.0.0.1 | localhost. Every entry must be separated by a pipe, and the values are trimmed.- Parameters:
sDefinition- The definition string. May benullor empty or invalid. Every non-empty trimmed text between pipes is interpreted as a host name.- Returns:
- this for chaining
-
setNonProxyHostsFromPipeString
@Nonnull public final HttpProxySettings setNonProxyHostsFromPipeString(@Nullable String sDefinition) Set all non-proxy hosts from a piped string as in127.0.0.1 | localhost. Every entry must be separated by a pipe, and the values are trimmed.
This is a shortcut for first clearing the list and then callingaddNonProxyHostsFromPipeString(String)- Parameters:
sDefinition- The definition string. May benullor empty or invalid. Every non-empty trimmed text between pipes is interpreted as a host name.- Returns:
- this for chaining
- Since:
- 10.0.0
- See Also:
-
getClone
- Specified by:
getClonein interfacecom.helger.base.clone.ICloneable<HttpProxySettings>
-
toString
-