Examples of JcrPropertyMap


Examples of org.apache.sling.jcr.resource.JcrPropertyMap

        } else if (type == InputStream.class) {
            return (Type) getInputStream(); // unchecked cast
        } else if (type == URL.class) {
            return (Type) getURL(); // unchecked cast
        } else if (type == Map.class || type == ValueMap.class) {
            return (Type) new JcrPropertyMap(getNode(), this.dynamicClassLoader); // unchecked cast
        } else if (type == PersistableValueMap.class ) {
            // check write
            try {
                getNode().getSession().checkPermission(getPath(),
                    "set_property");
View Full Code Here

Examples of org.apache.sling.jcr.resource.JcrPropertyMap

        ValueFactory valueFactory = rootNode.getSession().getValueFactory();

        rootNode.setProperty("bin", valueFactory.createBinary(instream));
        rootNode.getSession().save();

        ValueMap map = new JcrPropertyMap(rootNode);
        instream = map.get("bin", InputStream.class);
        assertNotNull(instream);
        String read = IOUtils.toString(instream);
        assertEquals("Stream read successfully", "this too shall pass", read);

        instream = map.get("bin", InputStream.class);
        assertNotNull(instream);
        read = IOUtils.toString(instream);
        assertEquals("Stream read successfully a second time", "this too shall pass", read);
    }
View Full Code Here

Examples of org.apache.sling.jcr.resource.JcrPropertyMap

        ValueMap map = createProperty(rootNode, value);
        assertValueType(value, map.get(PROP_NAME, defaultValue), defaultValue.getClass());
    }

    private void testDefaultValue(Node node, Object defaultValue) {
        JcrPropertyMap map = createPropertyMap(rootNode);
        assertSame(defaultValue, map.get(PROP_NAME_NIL, defaultValue));
    }
View Full Code Here

Examples of org.apache.sling.jcr.resource.JcrPropertyMap

            assertEquals(value, result);
        }
    }

    protected JcrPropertyMap createPropertyMap(final Node node) {
        return new JcrPropertyMap(node);
    }
View Full Code Here

Examples of org.apache.sling.jcr.resource.JcrPropertyMap

        search(vm.values().iterator(), VALUE1);
        search(vm.values().iterator(), VALUE2);
    }

    public void testContainsKeyEmpty() {
        final JcrPropertyMap map = createPropertyMap(rootNode);
        assertFalse(map.containsKey(""));
        assertNull(map.get(""));
    }
View Full Code Here

Examples of org.apache.sling.jcr.resource.JcrPropertyMap

        } else if (type == InputStream.class) {
            return (Type) getInputStream(); // unchecked cast
        } else if (type == URL.class) {
            return (Type) getURL(); // unchecked cast
        } else if (type == Map.class || type == ValueMap.class) {
            return (Type) new JcrPropertyMap(getNode()); // unchecked cast
        } else if (type == PersistableValueMap.class) {
            // check write
            try {
                getNode().getSession().checkPermission(getNode().getPath(),
                    "set_property");
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.