Class GnomeProxySearchStrategy
- java.lang.Object
-
- com.github.markusbernhardt.proxy.search.desktop.gnome.GnomeProxySearchStrategy
-
- All Implemented Interfaces:
ProxySearchStrategy
public class GnomeProxySearchStrategy extends Object implements ProxySearchStrategy
Loads the Gnome proxy settings from the Gnome GConf settings.The following settings are extracted from the configuration that is stored in .gconf folder found in the user's home directory:
- /system/http_proxy/use_http_proxy -> bool used only by gnome-vfs
- /system/http_proxy/host -> string "my-proxy.example.com" without "http://"
- /system/http_proxy/port -> int
- /system/http_proxy/use_authentication -> bool
- /system/http_proxy/authentication_user -> string
- /system/http_proxy/authentication_password -> string
- /system/http_proxy/ignore_hosts -> list-of-string
- /system/proxy/mode -> string THIS IS THE CANONICAL KEY; SEE BELOW
- /system/proxy/secure_host -> string "proxy-for-https.example.com"
- /system/proxy/secure_port -> int
- /system/proxy/ftp_host -> string "proxy-for-ftp.example.com"
- /system/proxy/ftp_port -> int
- /system/proxy/socks_host -> string "proxy-for-socks.example.com"
- /system/proxy/socks_port -> int
- /system/proxy/autoconfig_url -> string "http://proxy-autoconfig.example.com"
"none" -> No proxy is used
"manual" -> The user's configuration values are used (/system/http_proxy/{host,port,etc.})
"auto" -> The "/system/proxy/autoconfig_url" key is used
GNOME Proxy_configuration settings are explained here in detail
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
-
Constructor Summary
Constructors Constructor Description GnomeProxySearchStrategy()ProxySelector
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Gets the printable name of the search strategy.ProxySelectorgetProxySelector()Loads the proxy settings and initializes a proxy selector for the Gnome proxy settings.PropertiesreadSettings()Load the proxy settings from the gconf settings XML file.
-
-
-
Constructor Detail
-
GnomeProxySearchStrategy
public GnomeProxySearchStrategy()
ProxySelector- See Also:
ProxySelector()
-
-
Method Detail
-
getProxySelector
public ProxySelector getProxySelector() throws ProxyException
Loads the proxy settings and initializes a proxy selector for the Gnome proxy settings.- Specified by:
getProxySelectorin interfaceProxySearchStrategy- Returns:
- a configured ProxySelector, null if none is found.
- Throws:
ProxyException- on file reading error.
-
getName
public String getName()
Gets the printable name of the search strategy.- Specified by:
getNamein interfaceProxySearchStrategy- Returns:
- the printable name of the search strategy
-
readSettings
public Properties readSettings() throws ProxyException
Load the proxy settings from the gconf settings XML file.- Returns:
- the loaded settings stored in a properties object.
- Throws:
ProxyException- on processing error.
-
-