Package org.apache.wink.webdav.model

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


        activelock.setTimeout(LOCK_TIMEOUT);
        // a lock token is not necessary for MS compatibility

        Lockdiscovery lockdiscovery = new Lockdiscovery();
        lockdiscovery.getActivelock().add(activelock);
        Prop prop = new Prop();
        prop.setLockdiscovery(lockdiscovery);

        Response response =
            RuntimeDelegate.getInstance().createResponseBuilder().entity(prop).build();
        return response;
    }
View Full Code Here


        // the request is for all property names
        if (propfind.getPropname() != null) {
            Propstat propstat =
                response.getOrCreatePropstat(Response.Status.OK.getStatusCode(), null, null);
            Prop prop = propstat.getProp();
            // call the abstract method to allow the handler to fill in the
            // property names
            handler.setAllPropertyNames(this, prop, synd);
            // ensure that all property values are empty
            ensurePropertiesAreEmpty(prop);
        } else {
            Prop prop = null;
            // the request is for all properties
            if (propfind.getAllprop() != null) {
                prop = new Prop();
                handler.setAllPropertyNames(this, prop, synd);
            } else {
                // the request is for specific properties
                prop = propfind.getProp();
            }
View Full Code Here

        // the request is for all property names
        if (propfind.getPropname() != null) {
            Propstat propstat =
                response.getOrCreatePropstat(Response.Status.OK.getStatusCode(), null, null);
            Prop prop = propstat.getProp();
            // call the abstract method to allow the handler to fill in the
            // property names
            handler.setAllPropertyNames(this, prop, synd);
            // ensure that all property values are empty
            ensurePropertiesAreEmpty(prop);
        } else {
            Prop prop = null;
            // the request is for all properties
            if (propfind.getAllprop() != null) {
                prop = new Prop();
                handler.setAllPropertyNames(this, prop, synd);
            } else {
                // the request is for specific properties
                prop = propfind.getProp();
            }
View Full Code Here

        // the request is for all property names
        if (propfind.getPropname() != null) {
            Propstat propstat =
                response.getOrCreatePropstat(Response.Status.OK.getStatusCode(), null, null);
            Prop prop = propstat.getProp();
            // call the abstract method to allow the handler to fill in the
            // property names
            handler.setAllPropertyNames(this, prop, synd);
            // ensure that all property values are empty
            ensurePropertiesAreEmpty(prop);
        } else {
            Prop prop = null;
            // the request is for all properties
            if (propfind.getAllprop() != null) {
                prop = new Prop();
                handler.setAllPropertyNames(this, prop, synd);
            } else {
                // the request is for specific properties
                prop = propfind.getProp();
            }
View Full Code Here

                    expectedPropnames.add(propertyNames[i]);
                }
            }
            totalCovered += expectedPropnames.size();

            Prop prop = propstat.getProp();
            Set<QName> propnames =
                WebDAVModelHelper.extractPropertyNames(prop, new HashSet<QName>());
            Assert.assertEquals(expectedPropnames.size(), propnames.size());

            for (QName name : expectedPropnames) {
View Full Code Here

    protected static void checkCollectionProperties(Response response, String name) {

        // check it contains all collection properties with OK status
        checkCollectionPropertyNames(response);

        Prop prop = response.getPropstat().get(0).getProp();

        // check name property
        Assert.assertEquals(name, prop.getDisplayname().getValue());

        // check the resource type property
        Assert.assertTrue(prop.getResourcetype().getCollection() != null);
    }
View Full Code Here

        // check it contains the root collection properties with OK status
        HttpStatus[] rootStatuses = {HttpStatus.OK, HttpStatus.OK, HttpStatus.NOT_FOUND};
        checkProperties(response, PROPERTIES_COLLECTION, rootStatuses);

        Prop prop = response.getPropstat().get(0).getProp();
        // check name property
        String displayName = "";
        if (prop.getDisplayname().getValue() != null) {
            displayName = prop.getDisplayname().getValue();
        }
        Assert.assertEquals(name, displayName);

        // check the resource type property
        Assert.assertTrue(prop.getResourcetype().getCollection() != null);
    }
View Full Code Here

    protected static void checkDocumentProperties(Response response, String name) {

        // check it contains all document properties with OK status
        checkDocumentPropertyNames(response);

        Prop prop = response.getPropstat().get(0).getProp();
        // check name property
        Assert.assertEquals(name, prop.getDisplayname().getValue());

        // check the resource type property
        Assert.assertFalse(prop.getResourcetype().getCollection() != null);
    }
View Full Code Here

        Assert.assertEquals(HttpStatus.OK.getCode(), response.getStatus());
        MediaType mediaType = MediaType.valueOf(response.getContentType());
        // we can't clear MediaType params due to UnsupportedOperationException on the collection, so...
        Assert.assertEquals(MediaType.valueOf(MediaType.APPLICATION_XML_TYPE.toString()), mediaType);
        StringReader reader = new StringReader(response.getContentAsString());
        Prop prop =
            WebDAVModelHelper.unmarshal(WebDAVModelHelper.createUnmarshaller(),
                                        reader,
                                        Prop.class,
                                        "prop");
        List<Activelock> activelocks = prop.getLockdiscovery().getActivelock();
        Assert.assertNotNull(activelocks);
        Assert.assertEquals(1, activelocks.size());
        Assert.assertNotNull(activelocks.get(0).getLocktype().getWrite());
        Assert.assertNotNull(activelocks.get(0).getLockscope().getExclusive());
        Assert.assertEquals("0", activelocks.get(0).getDepth());
View Full Code Here

            // request
            String path = WebDAVCollectionResource.PATH + "/" + i;
            Propfind propfind = new Propfind();
            QName propertyName = new QName("blah");
            Prop prop = new Prop();
            prop.setProperty(propertyName);
            propfind.setProp(prop);
            Multistatus multistatus = propfind(propfind, path, 0);

            // 1 response
            Map<String, Response> responses = multistatus.getResponsesAsMapByHref();
            Assert.assertEquals(1, responses.size());
            Response response = responses.get(path);
            Assert.assertNotNull(response);
            Assert.assertEquals(1, response.getPropstat().size());
            Propstat propstat = response.getPropstat().get(0);
            Assert.assertEquals(HttpStatus.NOT_FOUND.getCode(), propstat.getStatusCode());
            prop = propstat.getProp();
            Assert.assertEquals(1, prop.getAny().size());
            Assert.assertNotNull(prop.getAnyByName(propertyName));
        }
    }
View Full Code Here

TOP

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

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.