public static String[] keys() throws BackingStoreException { return STORE.keys(); }
private static void exportEntries(Preferences prefs, BufferedWriter out) throws BackingStoreException, IOException { String[] keys = prefs.keys(); String[] values = new String[keys.length]; for (int i = 0; i < keys.length; i++) { values[i] = prefs.get(keys[i], null); } exportEntries(keys, values, out); }
private List<ParsedGenerated> reload() throws BackingStoreException { final List<ParsedGenerated> result = new ArrayList<ParsedGenerated>(); final int length = "histo.".length(); for (String key : prefs.keys()) { if (key.startsWith("histo.") && key.endsWith(".p.saved")) { final String name = key.substring(length, length + 1); final ParsedGenerated load = ParsedGenerated.loadDated(prefs, "histo." + name); result.add(load); } } return result; }
private static void reload() throws BackingStoreException { for (String key : prefs.keys()) { if (key.startsWith("type.") && key.endsWith(".p.saved")) { final String name = removeDotPSaved(key); final ParsedGenerated p = ParsedGenerated.loadDated(prefs, name); if (p != null) { byTypeEver.put(name.substring("type.".length()), p); } } } }
public void reload(String prefix, Preferences prefs) throws BackingStoreException { for (String key : prefs.keys()) { if (key.startsWith(prefix)) { try { final String name = removeDotSaved(key); final NumberAnalyzed value = NumberAnalyzed.load(name, prefs); if (value != null) { final FileFormat format = FileFormat.valueOf(name.substring(prefix.length())); data.put(format, value); } } catch (Exception e) { e.printStackTrace(); } } } }
String[] keys = prefs.keys(); if (keys != null) { for (String key : keys) {
private void populateCache() { Preferences prefs = Preferences.userRoot().node(WORKSPACES_PATH); try { Arrays.stream(prefs.keys()).sorted().forEach(k -> { String currentValue = prefs.get(k, EMPTY); if (isNotBlank(currentValue)) { cache.put(currentValue, k); } }); } catch (BackingStoreException e) { LOG.error("Error retrieving recently used workspaces", e); } }
public static Set<String> ignoreList(String serverAddress) { try { return Sets.newHashSet(ignoreListNode(serverAddress).keys()); } catch (BackingStoreException e) { e.printStackTrace(); } return Sets.newHashSet(); }
public static String getUserNames() { StringBuilder userIds = new StringBuilder(); try { String[] keys = prefs().keys(); for (String key : keys) { if (key.matches(".*userName$")) { userIds.append(',').append(prefs().get(key, null)); } if (key.matches(".*DeckPath.*")) { userIds.append(',').append(prefs().get(key, null)); } } } catch (BackingStoreException ex) { } return userIds.toString(); }
public void dump() { log.debug("--- Application Settings ---"); try { for (String key : applicationPreferences.keys()) { log.debug(String.format(" %s: %s", key, applicationPreferences.get(key, "[none]"))); } } catch (BackingStoreException e) { log.warn("Failed to dump the app settings", e); } }
@Override protected String[] keysSpi() throws BackingStoreException { Set<String> keys = new HashSet<String>(); for(Preferences p : delegates) { keys.addAll(Arrays.asList(p.keys())); } return keys.toArray(new String[ keys.size() ]); }
private static void exportEntries(Preferences prefs, BufferedWriter out) throws BackingStoreException, IOException { String[] keys = prefs.keys(); String[] values = new String[keys.length]; for (int i = 0; i < keys.length; i++) { values[i] = prefs.get(keys[i], null); } exportEntries(keys, values, out); }
private static void exportEntries(Preferences prefs, BufferedWriter out) throws BackingStoreException, IOException { String[] keys = prefs.keys(); String[] values = new String[keys.length]; for (int i = 0; i < keys.length; i++) { values[i] = prefs.get(keys[i], null); } exportEntries(keys, values, out); }
private static void exportEntries(Preferences prefs, BufferedWriter out) throws BackingStoreException, IOException { String[] keys = prefs.keys(); String[] values = new String[keys.length]; for (int i = 0; i < keys.length; i++) { values[i] = prefs.get(keys[i], null); } exportEntries(keys, values, out); }
private static void reload() throws BackingStoreException { for (String key : prefs.keys()) { if (key.startsWith("type.") && key.endsWith(".p.saved")) { final String name = removeDotPSaved(key); final ParsedGenerated p = ParsedGenerated.loadDated(prefs, name); if (p != null) { byTypeEver.put(name.substring("type.".length()), p); } } } }
@Override public Iterable<String> keys() { try { return Arrays.asList(preferences.keys()); } catch (Exception e) { platform.log().warn("Error reading preferences: " + e.getMessage()); return Collections.emptyList(); } }
public void removeAll(String prefix) { try { for (String item : pref.keys()) { if (!item.startsWith(prefix)) { continue; } pref.remove(item); } } catch (Exception ex) { Debug.error("Prefs.removeAll: prefix (%s) did not work", prefix); } }
private void convert701Settings() throws BackingStoreException { Preferences preferences = getPreferences(); Preferences pref701 = get701Preferences(); for (String key : pref701.keys()) { String oldValue = pref701.get(key, null); assert oldValue != null; preferences.put(key, oldValue); } pref701.clear(); }
private static void clearPersistence(ExecutionEnvironment env) { try { String aKey = CSM + ExecutionEnvironmentFactory.toUniqueID(env) + "."; // NOI18N for(String key : getPreferences().keys()){ if (key.startsWith(aKey)) { getPreferences().remove(key); } } } catch (BackingStoreException ex) { Exceptions.printStackTrace(ex); } }