Package java.util.prefs

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


        Arrays.sort(children);
        assertEquals("a", children[0]);
        assertEquals("b", children[1]);
        assertEquals(1, prefs2.getLong("pa", 0));
        assertEquals(2, prefs2.node("a").getLong("pb", 0));
        assertEquals(2, prefs2.node("/a").getLong("pb", 0));
        assertEquals(3, prefs2.node("/a/b").getLong("pc", 0));
        Preferences prefs2a = prefs2.node("/a");
        assertEquals(2, prefs2a.getLong("pb", 0));
        assertEquals(-1, prefs2.node("/a/c").getLong("px", -1));
        assertEquals(null, prefs2.node("/a/c").get("py", null));
View Full Code Here


        assertEquals("a", children[0]);
        assertEquals("b", children[1]);
        assertEquals(1, prefs2.getLong("pa", 0));
        assertEquals(2, prefs2.node("a").getLong("pb", 0));
        assertEquals(2, prefs2.node("/a").getLong("pb", 0));
        assertEquals(3, prefs2.node("/a/b").getLong("pc", 0));
        Preferences prefs2a = prefs2.node("/a");
        assertEquals(2, prefs2a.getLong("pb", 0));
        assertEquals(-1, prefs2.node("/a/c").getLong("px", -1));
        assertEquals(null, prefs2.node("/a/c").get("py", null));
        Preferences prefs2ab2 = prefs2.node("/a/b2");
View Full Code Here

    // by walking up the file path to the script directory and
    // using each folder as a preference node.
    File file = script.getFile();
    // Core script preferences are placed in the "core" node, all others
    // go into the "scripts" node.
    prefs = prefs.node(script.isCoreScript() ? "core" : "scripts");
    String[] parts = getScriptPath(file, false);
    for (int i = 0, l = parts.length; i < l; i++)
      prefs = prefs.node(parts[i]);
    return prefs;
  }
View Full Code Here

    // Core script preferences are placed in the "core" node, all others
    // go into the "scripts" node.
    prefs = prefs.node(script.isCoreScript() ? "core" : "scripts");
    String[] parts = getScriptPath(file, false);
    for (int i = 0, l = parts.length; i < l; i++)
      prefs = prefs.node(parts[i]);
    return prefs;
  }

  private static PrintStream getLogger(String name) {
    try {
View Full Code Here

    }
   
    protected final Preferences getNode() {
        Preferences prefs = Preferences.userNodeForPackage(applicationClass);
        for (String node : path) {
            prefs = prefs.node(node);
        }
        return prefs;
    }

    private static boolean equals(Object o1, Object o2) {
View Full Code Here

        try {
            Preferences root = Preferences.userRoot();
            Preferences node = root.node(CUSTOM_ID);

            if (node.nodeExists(code)) {
                return node.node(code);
            }

            for( String id : node.childrenNames() ) {
                Preferences child = node.node(id);
                String name = child.get(NAME_ID, null);
View Full Code Here

        for (int n = Math.min(prevsSize, connsSize); i < n; ++i)
            storeDiffs(connsNode.node("" + (i+1)), prevs.get(i), conns.get(i));
        for (; i < prevsSize; ++i)
            connsNode.node("" + (i+1)).removeNode();
        for (; i < connsSize; ++i)
            storeTo(conns.get(i), connsNode.node("" + (i+1)));
    }

    private void mergeAEs(Device prevDev, Device dev, Preferences deviceNode)
            throws BackingStoreException {
        Preferences aesNode = deviceNode.node("dcmNetworkAE");
View Full Code Here

            throws BackingStoreException {
        Preferences aesNode = deviceNode.node("dcmNetworkAE");
        Collection<String> aets = dev.getApplicationAETitles();
        for (String aet : prevDev.getApplicationAETitles()) {
            if (!aets.contains(aet))
                aesNode.node(aet).removeNode();
        }
        Collection<String> prevAETs = prevDev.getApplicationAETitles();
        List<Connection> devConns = dev.listConnections();
        for (ApplicationEntity ae : dev.getApplicationEntities()) {
            String aet = ae.getAETitle();
View Full Code Here

            Preferences parentNode) throws BackingStoreException {
        Preferences acsNode = parentNode.node("dcmAttributeCoercion");
        for (AttributeCoercion prev : prevs) {
            String cn = prev.getCommonName();
            if (acs.findByCommonName(prev.getCommonName()) == null)
                acsNode.node(cn).removeNode();
        }
        for (AttributeCoercion ac : acs) {
            String cn = ac.getCommonName();
            Preferences acNode = acsNode.node(cn);
            AttributeCoercion prev = prevs.findByCommonName(cn);
View Full Code Here

            ApplicationEntity ae, Preferences tcsNode, Role role)
                    throws BackingStoreException {
        Preferences roleNode = tcsNode.node(role.name());
        for (TransferCapability tc : prevAE.getTransferCapabilitiesWithRole(role))
            if (ae.getTransferCapabilityFor(tc.getSopClass(), role) == null)
                roleNode.node(tc.getSopClass()).removeNode();
        for (TransferCapability tc : ae.getTransferCapabilitiesWithRole(role)) {
            Preferences tcNode = roleNode.node(tc.getSopClass());
            TransferCapability prev =
                    prevAE.getTransferCapabilityFor(tc.getSopClass(), role);
            if (prev == 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.