Package java.util.prefs

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


            /* If required, convert from the old preferences node to the new
             * file (version 0.2.5)
             */
            versionsFile = new File(ContextHolder.getContext().getDBDirectory(), "versions.log");
            Preferences p = ContextHolder.getContext().getPreferences().node("dbupgrader");
            if (p.nodeExists("currentDataVersion")) {
                log.warn("Migrating database versions from preferences to properties file in "
                                + ContextHolder.getContext().getDBDirectory().getAbsolutePath() + ".");
                versions = new Properties();
                p = p.node("currentDataVersion");
                String[] c = p.keys();
View Full Code Here


    // audioboxes
    value = AudioBoxConfig.ID_DEFAULT;
    putDontOverwrite( childPrefs, KEY_AUDIOBOX, value );
    try {
      if( !childPrefs.nodeExists( NODE_AUDIOBOXES )) {
        childPrefs2  = childPrefs.node( NODE_AUDIOBOXES );
        new AudioBoxConfig( value, "Default", 8, 8, true ).toPrefs( childPrefs2.node( value ));
      }
    }
    catch( BackingStoreException e1 ) {
View Full Code Here

    // outputconfigs
    value = "out1to2";
    putDontOverwrite( childPrefs, KEY_OUTPUTCONFIG, value );
    try {
      if( !childPrefs.nodeExists( NODE_OUTPUTCONFIGS )) {
        childPrefs2 = childPrefs.node( NODE_OUTPUTCONFIGS );
        new RoutingConfig( value, "Out 1-2", new int[] { 0, 1 }, -90f ).toPrefs(
          childPrefs2.node( value ));
        value = "out1to8";
        new RoutingConfig( value, "Out 1-8", new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }, -45f ).toPrefs(
View Full Code Here

      warnings.add( e1.toString() );
    }

    // inputconfigs
    try {
      if( !childPrefs.nodeExists( NODE_INPUTCONFIGS )) {
        childPrefs2 = childPrefs.node( NODE_INPUTCONFIGS );
        value = "in1";
        new RoutingConfig( value, "In 1", new int[] { 0 }, 0f ).toPrefs(
          childPrefs2.node( value ));
        value = "in1to2";
View Full Code Here

    }
   
    // view
    childPrefs  = mainPrefs.node( NODE_VIEW );
    try {
      if( !childPrefs.nodeExists( NODE_SONAGRAM )) {
        childPrefs2 = childPrefs.node( NODE_SONAGRAM );
        new ConstQ().writePrefs( childPrefs2 );
      }
    }
    catch( BackingStoreException e1 ) {
View Full Code Here

      oCfgDynPrefs.setPreferences( null );
      oCfgNode = null;
    }

    try {
      if( (cfgID != null) && childPrefs.nodeExists( cfgID )) {
        oCfgNode  = childPrefs.node( cfgID );
        newCfg    = new RoutingConfig( oCfgNode );
//        oCfgNode.addPreferenceChangeListener( oCfgListener );
        oCfgDynPrefs.setPreferences( oCfgNode );
        oCfgDynPrefs.startListening();
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

                    .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

          p.removeNode();
        }
        else if (type.equals("local"))
        {
          final Properties props = new Properties();
          if (p.nodeExists("properties"))
          {
            final Preferences preferences = p.node("properties");
            final String[] strings = preferences.keys();
            for (int j = 0; j < strings.length; j++)
            {
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.