Class OsxProxySearchStrategy
- java.lang.Object
-
- com.github.markusbernhardt.proxy.search.desktop.osx.OsxProxySearchStrategy
-
- All Implemented Interfaces:
ProxySearchStrategy
public class OsxProxySearchStrategy extends Object implements ProxySearchStrategy
Loads the OSX system proxy settings from the settings file.All settings are stored in OSX in a special XML file format. These settings file are named plist files and contain nested dictionaries, arrays and values.
To parse this file we use a parser that is derived from a plist parser that comes with the xmlwise XML parser package:
http://code.google.com/p/xmlwise/
I modified that parser to work with the default Java XML parsing library.
The plist file is located on OSX at:
/Library/Preferences/SystemConfiguration/preferences.plist
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
-
Field Summary
Fields Modifier and Type Field Description static StringOVERRIDE_ACCEPTED_DEVICESstatic StringOVERRIDE_SETTINGS_FILE
-
Constructor Summary
Constructors Constructor Description OsxProxySearchStrategy()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 OSX proxy settings.
-
-
-
Field Detail
-
OVERRIDE_SETTINGS_FILE
public static final String OVERRIDE_SETTINGS_FILE
- See Also:
- Constant Field Values
-
OVERRIDE_ACCEPTED_DEVICES
public static final String OVERRIDE_ACCEPTED_DEVICES
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OsxProxySearchStrategy
public OsxProxySearchStrategy()
ProxySelector- See Also:
ProxySelector()
-
-
Method Detail
-
getProxySelector
public ProxySelector getProxySelector() throws ProxyException
Loads the proxy settings and initializes a proxy selector for the OSX 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
-
-