mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-18 02:27:42 +00:00
Merge pull request #1566 from APriestman/collaborative
Adding manual save and load to UserPreferences
This commit is contained in:
commit
4e73b26eff
@ -18,6 +18,7 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.core;
|
||||
|
||||
import java.util.prefs.BackingStoreException;
|
||||
import org.sleuthkit.autopsy.events.MessageServiceConnectionInfo;
|
||||
import java.util.prefs.PreferenceChangeListener;
|
||||
import java.util.prefs.Preferences;
|
||||
@ -58,6 +59,27 @@ public final class UserPreferences {
|
||||
private UserPreferences() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload all preferences from disk. This is only needed if the preferences
|
||||
* file is being directly modified on disk while Autopsy is running.
|
||||
*
|
||||
* @throws BackingStoreException
|
||||
*/
|
||||
public static void reloadFromStorage() throws BackingStoreException {
|
||||
preferences.sync();
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the current preferences to storage. This is only needed if the
|
||||
* preferences files are going to be copied to another location while
|
||||
* Autopsy is running.
|
||||
*
|
||||
* @throws BackingStoreException
|
||||
*/
|
||||
public static void saveToStorage() throws BackingStoreException {
|
||||
preferences.flush();
|
||||
}
|
||||
|
||||
public static void addChangeListener(PreferenceChangeListener listener) {
|
||||
preferences.addPreferenceChangeListener(listener);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user