use of com.mucommander.commons.conf.XmlConfigurationWriter in project mucommander by mucommander.
the class MuPreferences method write.
/**
* Saves the muCommander CONFIGURATION.
* @throws IOException if an I/O error occurs.
* @throws ConfigurationException if a CONFIGURATION related error occurs.
*/
void write() throws IOException, ConfigurationException {
// Clear the configuration before saving to drop preferences which are unused anymore
Configuration conf = new Configuration(MuPreferencesFile.getPreferencesFile(), () -> new XmlConfigurationReader(), out -> new XmlConfigurationWriter(out, ROOT_ELEMENT));
for (MuPreference preference : MuPreference.values()) conf.setVariable(preference.toString(), configuration.getVariable(preference.toString()));
// Remove preferences which are not relevant if we're not using MAC
if (!OsFamily.MAC_OS.isCurrent()) {
conf.removeVariable(USE_SCREEN_MENU_BAR);
}
configuration = conf;
configuration.write();
}
Aggregations