Package org.apache.james.mailbox.store.mail.model

Examples of org.apache.james.mailbox.store.mail.model.Property



            List<Property> currentProperties = getProperties();
            List<Property> newProperites = new ArrayList<Property>();
            for (int i = 0; i < currentProperties.size(); i++) {
                Property prop = currentProperties.get(i);
                newProperites.add(new JCRProperty(prop, logger));
            }
            // remove old properties, we will add a bunch of new ones
            NodeIterator iterator = node.getNodes("messageProperty");
            while (iterator.hasNext()) {
                iterator.nextNode().remove();
            }

            // store new properties
            for (int i = 0; i < newProperites.size(); i++) {
                JCRProperty prop = (JCRProperty) newProperites.get(i);
                Node propNode = node.addNode("messageProperty", "nt:unstructured");
                propNode.addMixin(PROPERTY_NODE_TYPE);
                prop.merge(propNode);
            }
        }
        this.node = node;

    }
View Full Code Here


            }

            List<Property> currentProperties = getProperties();
            List<Property> newProperites = new ArrayList<Property>();
            for (int i = 0; i < currentProperties.size(); i++) {
                Property prop = currentProperties.get(i);
                newProperites.add(new JCRProperty(prop, i, logger));
            }
            // remove old properties, we will add a bunch of new ones
            iterator = node.getNodes("messageProperty");
            while (iterator.hasNext()) {
                iterator.nextNode().remove();
            }

            // store new properties
            for (int i = 0; i < newProperites.size(); i++) {
                JCRProperty prop = (JCRProperty) newProperites.get(i);
                Node propNode = node.addNode("messageProperty", "nt:unstructured");
                propNode.addMixin(PROPERTY_NODE_TYPE);
                prop.merge(propNode);
            }
        }
        this.node = node;

    }
View Full Code Here

        // left to implement
    }

    @Test
    public void testPropertyToBytes() {
        final Property prop1 = new SimpleProperty("nspace", "localName", "test");
        byte[] value = getValue(prop1);
        final Property prop2 = getProperty(value);
        assertEquals(prop1.getNamespace(), prop2.getNamespace());
        assertEquals(prop1.getLocalName(), prop2.getLocalName());
        assertEquals(prop1.getValue(), prop2.getValue());
    }
View Full Code Here


            List<Property> currentProperties = getProperties();
            List<Property> newProperites = new ArrayList<Property>();
            for (int i = 0; i < currentProperties.size(); i++) {
                Property prop = currentProperties.get(i);
                newProperites.add(new JCRProperty(prop, logger));
            }
            // remove old properties, we will add a bunch of new ones
            NodeIterator iterator = node.getNodes("messageProperty");
            while (iterator.hasNext()) {
                iterator.nextNode().remove();
            }

            // store new properties
            for (int i = 0; i < newProperites.size(); i++) {
                JCRProperty prop = (JCRProperty) newProperites.get(i);
                Node propNode = node.addNode("messageProperty", "nt:unstructured");
                propNode.addMixin(PROPERTY_NODE_TYPE);
                prop.merge(propNode);
            }
        }
        this.node = node;

    }
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.store.mail.model.Property

Copyright © 2018 www.massapicom. 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.