Package java.util.prefs

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


        assertEquals("System Preference Node: " + p.absolutePath(), p
                .toString());

        assertEquals(0, p.childrenNames().length);
        assertEquals(0, p.keys().length);
        parent.removeNode();
        try {
            Preferences.userNodeForPackage(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
View Full Code Here


      }
      final Preferences authNode = storageBackend.node(name);
      final String url = authNode.get(URL_KEY, null);
      if (url == null)
      {
        authNode.removeNode();
        continue;
      }

      final long authTime = authNode.getLong(VERSION_KEY, 0);
      final DataHolder<T> data = new DataHolder<T>(create(url, authTime));
View Full Code Here

    this.harness.check(two, "A valid key, on an invalid subnode");
   
    try
      {
        _prefs.flush();
        _prefs.removeNode();
      }
    catch (BackingStoreException e)
      {
        print(e.getLocalizedMessage());
        this.harness.fail("call to testSpecialCharacters() fail to removeNode");
View Full Code Here

        final String name = childNodeNames[i];
        final Preferences p = userPreferences.node(name);
        final String type = p.get("type", null);
        if (type == null)
        {
          p.removeNode();
        }
        else if (type.equals("local"))
        {
          final Properties props = new Properties();
          if (p.nodeExists("properties"))
View Full Code Here

    try
    {
      final Preferences node = userPreferences.node(name);
      if (node != null)
      {
        node.removeNode();
        userPreferences.flush();
      }
    }
    catch (BackingStoreException e)
    {
View Full Code Here

  public void remove( int index )
  throws BackingStoreException
  {
    if( (index < 0) || (index >= collData.size()) ) throw new ArrayIndexOutOfBoundsException();
    final Preferences node = prefs.node( String.valueOf( collData.size() - 1 ));
    node.removeNode();
    collData.remove( index );
    for( int i = index; i < collData.size(); i++ ) {
      dataToNode( i );
    }
  }
View Full Code Here

        String reportTypeName = ReportConfig.getReportTypeName(reportClass);
        Preferences reportClassNode = Prefs.REPORT_CONFIG_PREFS.node(reportTypeName);
        String[] reportNames = reportClassNode.childrenNames();
        for (String reportName : reportNames) {
            Preferences reportNode = reportClassNode.node(reportName);
            reportNode.removeNode();
        }
    }

    /**
     * clears individual preference node
View Full Code Here

    public void clearReportConfig(String reportClassSimpleName, String reportName)
            throws NoSuchFieldException, IllegalAccessException, BackingStoreException, ClassNotFoundException {
        Class<? extends TotalReport> reportClass = getClassFromName(reportClassSimpleName);
        Preferences reportNode = prefs.node(ReportConfig.getReportTypeName(reportClass)).node(reportName);
        reportNode.removeNode();
    }

    public LinkedList<Integer> getViewHeader() {
        return viewHeader;
    }
View Full Code Here

    if (locale.equals("es")) //$NON-NLS-1$
      pos = 1;
    if (locale.equals("ca")) //$NON-NLS-1$
      pos = 2;
    try {
      prefs.removeNode();
      prefs.flush();
      JOptionPane.showMessageDialog(null, success[pos], "Biogenesis", JOptionPane.INFORMATION_MESSAGE); //$NON-NLS-1$
    } catch (BackingStoreException e) {
      JOptionPane.showMessageDialog(null, failed[pos], "Biogenesis", JOptionPane.INFORMATION_MESSAGE); //$NON-NLS-1$
    }
View Full Code Here

        Preferences result = prefsBase.node(key);

        // if we are recycling a node from the past, delete and recreate it.
        if (exists(result)) {
            try {
                result.removeNode();
                result.flush();
                result = prefsBase.node(key);
            } catch (BackingStoreException bse) {
            }
        }
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.