Class FirefoxPreferencesParser

java.lang.Object
net.sourceforge.jnlp.proxy.browser.FirefoxPreferencesParser
All Implemented Interfaces:
PreferencesParser

public final class FirefoxPreferencesParser extends 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"));
  • Field Details

  • Constructor Details

    • FirefoxPreferencesParser

      public FirefoxPreferencesParser()
  • Method Details

    • parse

      public void parse() throws IOException
      Parse the preferences file
      Specified by:
      parse in interface PreferencesParser
      Throws:
      IOException - if an exception occurs while reading the preferences file.
    • getPreferences

      public Map<String,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:
      getPreferences in interface PreferencesParser
      Returns:
      a map containing firefox' preferences