All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.markusbernhardt.proxy.search.browser.firefox.WinFirefoxProfileSource Maven / Gradle / Ivy

package com.github.markusbernhardt.proxy.search.browser.firefox;

import java.io.File;
import java.io.IOException;

import com.sun.jna.platform.win32.Shell32Util;
import com.sun.jna.platform.win32.ShlObj;

/*****************************************************************************
 * Finds the Firefox profile on Windows platforms. On Windows the profiles are
 * located in the users appdata directory under:
 * 

* Mozilla\Firefox\Profiles\ *

* The location of the appdata folder is read from the windows registry. * * @author Markus Bernhardt, Copyright 2016 * @author Bernd Rosstauscher, Copyright 2009 ****************************************************************************/ // TODO 02.06.2015 bros Format has changed in newer versions of firefox. class WinFirefoxProfileSource implements FirefoxProfileSource { /************************************************************************* * Constructor ************************************************************************/ public WinFirefoxProfileSource() { super(); } /************************************************************************* * Reads the current location of the app data folder from the registry. * * @return a path to the folder. ************************************************************************/ private String getAppFolder() { return Shell32Util.getFolderPath(ShlObj.CSIDL_APPDATA); } /************************************************************************* * Get profiles.ini for the Windows Firefox profile * * @throws IOException * on error. ************************************************************************/ @Override public File getProfilesIni() throws IOException { File appDataDir = new File(getAppFolder()); return new File(appDataDir, "Mozilla" + File.separator + "Firefox" + File.separator + "profiles.ini"); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy