Package org.apache.wink.webdav.model

Examples of org.apache.wink.webdav.model.Propfind


                             String propfindXml,
                             String depthStr,
                             CollectionPropertyHandler provider) throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
View Full Code Here


    @Test
    public void test2() throws Exception {

        // test read
        String input = loadStreamToString(getClass().getResourceAsStream("propfind2.xml"));
        Propfind propfind = read(input);
        Assert.assertNull(propfind.getProp());
        Assert.assertFalse(propfind.isAllprop());
        Assert.assertTrue(propfind.isPropname());

        // test write
        Diff diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());

        // test runtime creation
        propfind = new Propfind();
        propfind.setPropname(new Propname());
        diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());
    }
View Full Code Here

    @Test
    public void test3() throws Exception {

        // test read
        String input = loadStreamToString(getClass().getResourceAsStream("propfind3.xml"));
        Propfind propfind = read(input);
        Assert.assertNull(propfind.getProp());
        Assert.assertTrue(propfind.isAllprop());
        Assert.assertFalse(propfind.isPropname());

        // test write
        Diff diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());

        // test runtime creation
        propfind = new Propfind();
        propfind.setAllprop(new Allprop());
        diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());
    }
View Full Code Here

        diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());
    }

    private Propfind read(String input) throws Exception {
        Propfind propfind = Propfind.unmarshal(new StringReader(input));
        return propfind;
    }
View Full Code Here

    @Test
    public void test1() throws Exception {

        // test read
        String input = loadStreamToString(getClass().getResourceAsStream("propfind1.xml"));
        Propfind propfind = read(input);
        Prop prop = propfind.getProp();
        Assert.assertEquals(PROPERTIES.length, prop.getAny().size());
        for (QName qname : PROPERTIES) {
            Element element = prop.getAnyByName(qname);
            Assert.assertNotNull(element);
            Assert.assertEquals(qname.getNamespaceURI(), element.getNamespaceURI());
            Assert.assertEquals(qname.getLocalPart(), element.getLocalName());
        }
        Assert.assertFalse(propfind.isAllprop());
        Assert.assertFalse(propfind.isPropname());

        // test write
        Diff diff = new Diff(input, write(propfind));
        Assert.assertTrue(diff.toString(), diff.similar());

        // test runtime creation
        propfind = new Propfind();
        prop = new Prop();
        propfind.setProp(prop);
        prop.setProperty(PROPERTIES[0]);
        prop.setProperty(PROPERTIES[1]);
        prop.setProperty(PROPERTIES[2]);
        prop.setProperty(PROPERTIES[3]);
        diff = new Diff(input, write(propfind));
View Full Code Here

     */
    public Response propfind(SyndEntry entry, String propfindXml, PropertyHandler handler)
        throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
View Full Code Here

                             String propfindXml,
                             String depthStr,
                             CollectionPropertyHandler provider) throws IOException {

        // parse the request (no content means 'all properties')
        Propfind propfind = null;
        if (propfindXml == null || propfindXml.length() == 0) {
            propfind = new Propfind();
            propfind.setAllprop(new Allprop());
        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
View Full Code Here

TOP

Related Classes of org.apache.wink.webdav.model.Propfind

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.