Class OsxProxySearchStrategy
java.lang.Object
com.github.markusbernhardt.proxy.search.desktop.osx.OsxProxySearchStrategy
- All Implemented Interfaces:
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets the printable name of the search strategy.Loads the proxy settings and initializes a proxy selector for the OSX proxy settings.
-
Field Details
-
OVERRIDE_SETTINGS_FILE
- See Also:
-
OVERRIDE_ACCEPTED_DEVICES
- See Also:
-
-
Constructor Details
-
OsxProxySearchStrategy
public OsxProxySearchStrategy()ProxySelector- See Also:
-
-
Method Details
-
getProxySelector
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
Gets the printable name of the search strategy.- Specified by:
getNamein interfaceProxySearchStrategy- Returns:
- the printable name of the search strategy
-