public static void store(JadxSettings settings) { try { String jsonSettings = makeString(settings); LOG.debug("Saving settings: {}", jsonSettings); PREFS.put(JADX_GUI_KEY, jsonSettings); PREFS.sync(); } catch (Exception e) { LOG.error("Error store settings", e); } }
public static void persistMe(String key) throws BackingStoreException { prefs.sync(); prefs.put("license", key); }
private static void restoreNow() { try { prefs.sync(); fullEver = ParsedGenerated.loadDated(prefs, "full"); historicalData = new HistoricalData(prefs); reload(); formatCounterEver.reload("format.", prefs); } catch (BackingStoreException e) { Log.error("Error reloading stats " + e); byTypeEver.clear(); } }
public boolean setPref(String section, String key, String value) { try { ini.put(section, key, value); prefs.sync(); return true; } catch (Exception e) { e.printStackTrace(); } return false; }
@Override protected void syncSpi() throws BackingStoreException { stored.sync(); }
@Override public void sync() throws BackingStoreException { actualPreferences.sync(); }
@Override protected void syncSpi() throws BackingStoreException { stored.sync(); }
public void globalSet(String key, String value) throws BackingStoreException { prefs.put(key, value); prefs.sync(); }
/** * Implements the <CODE>sync</CODE> method as per the specification in * {@link java.util.prefs.Preferences#sync()}. * * This implementation just call parent's <code>sync()</code> method. * * @throws BackingStoreException if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it. */ @Override public void sync() throws BackingStoreException { parent().sync(); }
public synchronized void closePrefs() { if (_preference != null) { try { _preference.sync(); } catch (BackingStoreException e) { e.printStackTrace(); } } _preference = null; }
/** * Implements the <CODE>sync</CODE> method as per the specification in * {@link java.util.prefs.Preferences#sync()}. * * This implementation just call parent's <code>sync()</code> method. * * @throws BackingStoreException if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it. */ @Override public void sync() throws BackingStoreException { parent().sync(); }
/** * Implements the <CODE>sync</CODE> method as per the specification in * {@link java.util.prefs.Preferences#sync()}. * * This implementation just call parent's <code>sync()</code> method. * * @throws BackingStoreException if this operation cannot be completed due to a failure in the backing store, or inability to communicate with it. */ @Override public void sync() throws BackingStoreException { parent().sync(); }
public void globalRemove(String key) throws BackingStoreException { prefs.remove(key); prefs.sync(); }
public static void main(String[] args) throws BackingStoreException { Preferences preferences = Preferences.systemRoot().node("/mercyblitz"); Stream.of(preferences.childrenNames()).forEach(System.out::println); preferences.put("name", "小马哥"); preferences.sync(); System.out.println(preferences.get("name", "")); } }
/** * Sets the key prefix. * * @param keyPrefix * the new key prefix */ public static void setKeyPrefix(final String keyPrefix) { UserPreferences.keyPrefix = keyPrefix; try { systemRoot.sync(); } catch (final Exception e) { JKExceptionUtil.handle(e); } }
@Override public void windowClosing(final WindowEvent e) { prefs.putInt("x", getX()); prefs.putInt("y", getY()); prefs.putInt("h", getHeight()); prefs.putInt("w", getWidth()); try { prefs.sync(); } catch (BackingStoreException ex) { logger.log(Level.WARNING, "Unable to save window preferences", ex); } } });
@Override public void windowClosing(final WindowEvent e) { prefs.putInt("x", getX()); prefs.putInt("y", getY()); prefs.putInt("h", getHeight()); prefs.putInt("w", getWidth()); try { prefs.sync(); } catch (BackingStoreException ex) { logger.log(Level.WARNING, "Unable to save window preferences", ex); } } });
@Override public byte[] getRaw(String name) throws StorageException { byte[] data; try { Preferences prefs = getPreferences(); prefs.sync(); data = prefs.getByteArray(name, null); } catch (BackingStoreException e) { throw new StorageException("User preference storage failed", e); } return data; }
private static void restoreNow() { try { prefs.sync(); fullEver = ParsedGenerated.loadDated(prefs, "full"); historicalData = new HistoricalData(prefs); reload(); formatCounterEver.reload("format.", prefs); } catch (BackingStoreException e) { Log.error("Error reloading stats " + e); byTypeEver.clear(); } }