Package java.util.prefs

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


    try {
      if ((getPreferences(wikipedia) != null) &&
          (getPreferences(wikipedia).nodeExists(property)) &&
          (getPreferences(wikipedia).nodeExists(property + "/" + subProperty))) {
        Preferences node = getPreferences(wikipedia).node(property + "/" + subProperty);
        String[] children = node.keys();
        for (String child : children) {
          values.setProperty(child, node.get(child, ""));
        }
      }
    } catch (BackingStoreException e) {
View Full Code Here


      EnumWikipedia wikipedia, String property) {
    List<String> result = new ArrayList<String>();
    if (getPreferences(wikipedia) != null) {
      try {
        Preferences node = getPreferences(wikipedia).node(property);
        String[] children = node.keys();
        for (int i = 0; i < children.length; i++) {
          result.add(node.get(children[i], ""));
        }
      } catch (BackingStoreException e) {
        //
View Full Code Here

        String nodeName = property + "/" + subProperty;
        if (!getPreferences(wikipedia).nodeExists(nodeName)) {
          return result;
        }
        Preferences node = getPreferences(wikipedia).node(nodeName);
        String[] children = node.keys();
        for (int i = 0; i < children.length; i++) {
          result.add(node.get(children[i], ""));
        }
      } catch (BackingStoreException e) {
        //
View Full Code Here

          if (Modifier.isPublic(m.getModifiers()) &&
              m.getName().startsWith("set") &&
              (m.getGenericParameterTypes().length == 1)) {
            String parameterName = "" + Character.toLowerCase(m.getName().charAt(3)) + m.getName().substring(4);
            boolean exist = false;
            for (String key : node.keys()) {
              if (parameterName.equals(key)) {
                exist = true;
              }
            }
            if (exist) {
View Full Code Here

            if (Modifier.isPublic(m.getModifiers()) &&
                m.getName().startsWith("set") &&
                (m.getGenericParameterTypes().length == 1)) {
              String parameterName = "" + Character.toLowerCase(m.getName().charAt(3)) + m.getName().substring(4);
              boolean exist = false;
              for (String key : node.keys()) {
                if (parameterName.equals(key)) {
                  exist = true;
                }
              }
              if (exist) {
View Full Code Here

        Principal userPrincipal = createPrincipal(user.getSubject(), UserPrincipal.class);            
        this.principal = userPrincipal.getName();
        try
        {
            Preferences userAttributes = user.getUserAttributes();
            String[] keys = userAttributes.keys();
            for (int ix = 0; ix < keys.length; ix++)
            {
                attributes.add(new StringAttribute(keys[ix], userAttributes.get(keys[ix], "n/a")));
            }
        }
View Full Code Here

        recentWorkspaces.clear();

        TreeMap numberToFile = new TreeMap();
        Preferences recentNode = preferences.node(SETTINGS_RECENT_WORKSPACES);
        try {
            String[] keys = recentNode.keys();
            for (int i = 0; i < keys.length; i++) {
                String key = keys[i];
                String fileName = recentNode.get(key, null);
                if (fileName != null) {
                    numberToFile.put(new Integer(key), fileName);
View Full Code Here

    assertEquals("8value", mock1.get("/K/E\\Y\\abc~@!#$%^&*(\\", null));
    assertNull(mock1.get("/k/e/y", null));
    assertEquals("7value", mock1.get("/K/E/Y", null));
    assertEquals("1value", mock1.get("key", null));

    String[] keys = mock1.keys();
    assertEquals(4, keys.length);
    for (int i = 0; i < keys.length; i++) {
      String key = keys[i];
      assertTrue("key".equals(key) || "KEY".equals(key)
          || "/K/E/Y".equals(key)
View Full Code Here

    p.getDouble(null, 0.1);
    p.getInt(null, 1);
    p.getLong(null, 1l);
    p.isUserNode();
    try {
      p.keys();
    } catch (BackingStoreException e) {
    }
    p.name();
    p.node(null);
    try {
View Full Code Here

        {
          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++)
            {
              final String string = strings[j];
              final String value = preferences.get(string, null);
              if (value != null)
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.