Class FirefoxPreferencesParser
- java.lang.Object
-
- net.sourceforge.jnlp.proxy.browser.FirefoxPreferencesParser
-
- All Implemented Interfaces:
PreferencesParser
public final class FirefoxPreferencesParser extends java.lang.Object implements PreferencesParser
A parser for Firefox's preferences file. It can 'parse' Firefox's preferences file and expose the preferences in a simple to use format.
Sample usage:FirefoxPreferencesParser p = new FirefoxPreferencesParser(prefsFile); p.parse(); Map<String,String> prefs = p.getPreferences(); System.out.println("blink allowed: " + prefs.get("browser.blink_allowed"));
-
-
Constructor Summary
Constructors Constructor Description FirefoxPreferencesParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>getPreferences()Get the firefox preferences as a map (key,value pair).voidparse()Parse the preferences file
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
prefs
java.util.Map<java.lang.String,java.lang.String> prefs
-
-
Method Detail
-
parse
public void parse() throws java.io.IOExceptionParse the preferences file- Specified by:
parsein interfacePreferencesParser- Throws:
java.io.IOException- if an exception occurs while reading the preferences file.
-
getPreferences
public java.util.Map<java.lang.String,java.lang.String> getPreferences()
Get the firefox preferences as a map (key,value pair). Note that all values (including integers and booleans) are stored as a string, so conversion to an appropriate type may be required.- Specified by:
getPreferencesin interfacePreferencesParser- Returns:
- a map containing firefox' preferences
-
-