/** * Load preferences from the new file format. * * @param newPerfsFile FileWrapper containing the preferences information. * @throws XMLException Thrown if error reading preferences file. */ private void loadNewPrefs(FileWrapper newPrefsFile) throws XMLException { try { try { _settingsCache.load(newPrefsFile.getPath(), getClass().getClassLoader()); } catch (DuplicateObjectException ex) { s_log.error("Cache should have been empty", ex); } Iterator<LAFPreferences> it = _settingsCache.getAllForClass(LAFPreferences.class); if (it.hasNext()) { _lafPrefs = it.next(); } else { s_log.error("LAFPreferences object not loaded"); } } catch (FileNotFoundException ignore) { // property file not found for user - first time user ran pgm. } }
/** * Save preferences to disk. * * @param prefsFile File to save preferences to. */ private void savePrefs(FileWrapper prefsFile) throws IOException, XMLException { _settingsCache.save(prefsFile.getPath()); }