Package com.googlecode.sardine

Examples of com.googlecode.sardine.DavResource


    public void shouldCreateFolder() throws Exception {
        String folderName = testFolder();
        String uri = resourceUri(folderName);
        sardine.createDirectory(uri);
        assertTrue(sardine.exists(uri));
        DavResource folder = getResourceAtURI(uri);
        assertEquals(0l, folder.getContentLength().longValue());
    }
View Full Code Here


        String fileUri = folderUri + "/testFile" + UUID.randomUUID().toString();
        sardine.put(fileUri, fileStream);

        assertTrue(sardine.exists(fileUri));
        DavResource file = getResourceAtURI(fileUri);
        byte[] fileBytes = IoUtil.readBytes(getClass().getClassLoader().getResourceAsStream("textfile.txt"));
        assertEquals(fileBytes.length, file.getContentLength().longValue());
    }
View Full Code Here

        Map<String, String> propertiesToAdd = new HashMap<String, String>();
        propertiesToAdd.put("prop1", "value1");
        propertiesToAdd.put("prop2", "value2");
        sardine.setCustomProps(resourceUri, propertiesToAdd, null);

        DavResource resource = sardine.getResources(resourceUri).get(0);
        Map<String, String> customProps = resource.getCustomProps();
        assertEquals("value1", customProps.get("prop1"));
        assertEquals("value2", customProps.get("prop2"));

        sardine.setCustomProps(resourceUri, null, Arrays.asList("prop2", "prop3"));
        resource = sardine.getResources(resourceUri).get(0);
        customProps = resource.getCustomProps();
        assertEquals("value1", customProps.get("prop1"));
        assertFalse(customProps.containsKey("prop2"));
    }
View Full Code Here

TOP

Related Classes of com.googlecode.sardine.DavResource

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.