Package org.eclipse.rdf4j.common.app.net
Class ProxySettings
- java.lang.Object
-
- org.eclipse.rdf4j.common.app.net.ProxySettings
-
- All Implemented Interfaces:
Configuration
public class ProxySettings extends Object implements Configuration
Utility class for handling proxy connection settings.
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROXY_SETTINGS_FILENAME
-
Fields inherited from interface org.eclipse.rdf4j.common.app.config.Configuration
DEFAULT_RESOURCES_LOCATION, DIR, RESOURCES_LOCATION
-
-
Constructor Summary
Constructors Constructor Description ProxySettings(File applicationDataDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Clean up configuration resources.String
getFtpProxyHost()
String
getFtpProxyPort()
String
getHttpProxyHost()
String
getHttpProxyPort()
Get HTTP proxy port as stringString
getHttpsProxyHost()
Get HTTPS proxy hostString
getHttpsProxyPort()
String
getNonProxyHostsStarting()
Get the semicolon-separated list of hostnames starting with given strings, that do not use the proxy settings.boolean
getProxiesEnabled()
String
getSocksProxyHost()
String
getSocksProxyPort()
void
init()
Initialize the configuration settings.void
load()
(Re-)loads the proxy system properties.void
save()
Saves the currently known settings.void
setFtpProxyHost(String ftpProxyHost)
void
setFtpProxyPort(String ftpProxyPort)
void
setHttpProxyHost(String httpProxyHost)
void
setHttpProxyPort(String httpProxyPort)
Set HTTP proxy portvoid
setHttpsProxyHost(String httpsProxyHost)
Get HTTPS proxy hostvoid
setHttpsProxyPort(String httpsProxyPort)
void
setNonProxyHostsStarting(String nonProxyHostsStarting)
Set the semicolon separated list of hostnames starting with given strings, that do not use the proxy settings.void
setProperty(String key, String val)
void
setProxiesEnabled(boolean proxiesEnabled)
void
setSocksProxyHost(String socksProxyHost)
void
setSocksProxyPort(String socksProxyPort)
-
-
-
Field Detail
-
PROXY_SETTINGS_FILENAME
public static final String PROXY_SETTINGS_FILENAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProxySettings
public ProxySettings(File applicationDataDir) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getProxiesEnabled
public boolean getProxiesEnabled()
-
setProxiesEnabled
public void setProxiesEnabled(boolean proxiesEnabled)
- Parameters:
proxiesEnabled
-
-
getHttpProxyHost
public String getHttpProxyHost()
- Returns:
- proxy
-
setHttpProxyHost
public void setHttpProxyHost(String httpProxyHost)
- Parameters:
httpProxyHost
-
-
getHttpProxyPort
public String getHttpProxyPort()
Get HTTP proxy port as string- Returns:
- proxy port
-
setHttpProxyPort
public void setHttpProxyPort(String httpProxyPort)
Set HTTP proxy port- Parameters:
httpProxyPort
- proxy port
-
getHttpsProxyHost
public String getHttpsProxyHost()
Get HTTPS proxy host- Returns:
- proxy host as string
-
setHttpsProxyHost
public void setHttpsProxyHost(String httpsProxyHost)
Get HTTPS proxy host- Parameters:
httpsProxyHost
-
-
getHttpsProxyPort
public String getHttpsProxyPort()
-
setHttpsProxyPort
public void setHttpsProxyPort(String httpsProxyPort)
-
getFtpProxyHost
public String getFtpProxyHost()
-
setFtpProxyHost
public void setFtpProxyHost(String ftpProxyHost)
-
getFtpProxyPort
public String getFtpProxyPort()
-
setFtpProxyPort
public void setFtpProxyPort(String ftpProxyPort)
-
getSocksProxyHost
public String getSocksProxyHost()
-
setSocksProxyHost
public void setSocksProxyHost(String socksProxyHost)
-
getSocksProxyPort
public String getSocksProxyPort()
-
setSocksProxyPort
public void setSocksProxyPort(String socksProxyPort)
-
getNonProxyHostsStarting
public String getNonProxyHostsStarting()
Get the semicolon-separated list of hostnames starting with given strings, that do not use the proxy settings.
-
setNonProxyHostsStarting
public void setNonProxyHostsStarting(String nonProxyHostsStarting)
Set the semicolon separated list of hostnames starting with given strings, that do not use the proxy settings.
-
load
public void load() throws IOException
(Re-)loads the proxy system properties.- Specified by:
load
in interfaceConfiguration
- Throws:
IOException
- if the configuration settings could not be loaded due to an I/O problem.
-
save
public void save() throws IOException
Saves the currently known settings.- Specified by:
save
in interfaceConfiguration
- Throws:
IOException
- if the configuration settings could not be saved due to an I/O problem.
-
destroy
public void destroy() throws IOException
Description copied from interface:Configuration
Clean up configuration resources.- Specified by:
destroy
in interfaceConfiguration
- Throws:
IOException
- if one or more resources could not be cleaned up. Implementations should attempt to clean up as many resources as possible before returning or throwing an exception.
-
init
public void init() throws IOException
Description copied from interface:Configuration
Initialize the configuration settings.- Specified by:
init
in interfaceConfiguration
- Throws:
IOException
- if the configuration settings could not be initialized because of an I/O problem.
-
-