Package java.util.prefs

Examples of java.util.prefs.Preferences.nodeExists()


            }

            Preferences userRoot = Preferences.userRoot();

            // if there are no rhq-agent prefs stored then there is nothing to migrate
            if (!userRoot.nodeExists(NODE_PARENT)) {
                return;
            }

            Properties configProps = new Properties();
            Preferences topNode = userRoot.node(NODE_PARENT);
View Full Code Here


          (valueClass != null)) {
        if (!getPreferences(wikipedia).nodeExists(property)) {
          return null;
        }
        Preferences globalNode = getPreferences(wikipedia).node(property);
        if (!globalNode.nodeExists(name)) {
          return null;
        }
        Preferences node = globalNode.node(name);
        Object result = valueClass.newInstance();
        Method[] methods = valueClass.getMethods();
View Full Code Here

  public void removePojo(
      EnumWikipedia wikipedia, String property, String id) {
    if ((getPreferences(wikipedia) != null) && (property != null) && (id != null)) {
      Preferences globalNode = getPreferences(wikipedia).node(property);
      try {
        if (globalNode.nodeExists(id)) {
          Preferences node = globalNode.node(id);
          node.removeNode();
        }
      } catch (BackingStoreException e) {
        //
View Full Code Here

          (valueClass != null)) {
        if (!getPreferences(wikipedia).nodeExists(property)) {
          return null;
        }
        Preferences globalNode = getPreferences(wikipedia).node(property);
        if (!globalNode.nodeExists(name)) {
          return null;
        }
        Preferences pageNode = globalNode.node(name);
        ArrayList<Object> results = new ArrayList<Object>();
        int i = 0;
View Full Code Here

          return null;
        }
        Preferences pageNode = globalNode.node(name);
        ArrayList<Object> results = new ArrayList<Object>();
        int i = 0;
        while (pageNode.nodeExists(Integer.toString(i))) {
          Preferences node = pageNode.node(Integer.toString(i));
          Object result = valueClass.newInstance();
          Method[] methods = valueClass.getMethods();
          Method fixValuesMethod = null;
          for (Method m : methods) {
View Full Code Here

      try {
        if (!getPreferences().nodeExists(PROPERTY_WINDOW)) {
          return;
        }
        Preferences node = getPreferences().node(PROPERTY_WINDOW);
        if (!node.nodeExists(window.getName())) {
          return;
        }
        node = node.node(window.getName());
        window.setLocation(
            node.getInt(PROPERTY_WINDOW_X, 0),
View Full Code Here

    assertTrue(pref.nodeExists("child"));
    assertTrue(pref.nodeExists("child/grandchild"));
    grandchild.removeNode();
    assertTrue(pref.nodeExists("child"));
    assertFalse(pref.nodeExists("child/grandchild"));
    assertFalse(grandchild.nodeExists(""));

    assertFalse(pref.nodeExists("child2/grandchild"));
    pref.node("child2/grandchild");
    assertTrue(pref.nodeExists("child2/grandchild"));
  }
View Full Code Here

    pref.removeNode();

    assertFalse(child.nodeExists(""));
    assertFalse(child1.nodeExists(""));
    assertFalse(grandchild.nodeExists(""));
    assertFalse(pref.nodeExists(""));
  }

  // public void testAddNodeChangeListener() throws BackingStoreException {
  // try {
View Full Code Here

      in = PreferencesTest.class.getResourceAsStream("/prefs/java/util/prefs/userprefs.xml");
      Preferences.importPreferences(in);

      prefs = Preferences.userNodeForPackage(PreferencesTest.class);
      assertEquals(1, prefs.childrenNames().length);
      assertTrue(prefs.nodeExists("mock/child/grandson"));
      assertEquals("newvalue", prefs.get("prefskey", null));
      assertEquals("oldvalue2", prefs.get("prefskey2", null));
      assertEquals("newvalue3", prefs.get("prefskey3", null));

      in = PreferencesTest.class
View Full Code Here

    } catch (BackingStoreException e) {
    }
    p.name();
    p.node(null);
    try {
      p.nodeExists(null);
    } catch (BackingStoreException e1) {
    }
    p.parent();
    p.put(null, null);
    p.putBoolean(null, false);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.