Package com.googlecode.sardine

Examples of com.googlecode.sardine.DavResource


    List<DavResource> resources = new ArrayList<DavResource>(responses.size());
    for (Response response : responses)
    {
      try
      {
        resources.add(new DavResource(response));
      }
      catch (URISyntaxException e)
      {
        log.warn(String.format("Ignore resource with invalid URI %s", response.getHref().get(0)));
      }
View Full Code Here


    List<DavResource> resources = new ArrayList<DavResource>(responses.size());
    for (Response response : responses)
    {
      try
      {
        resources.add(new DavResource(response));
      }
      catch (URISyntaxException e)
      {
        log.warn(String.format("Ignore resource with invalid URI %s", response.getHref().get(0)));
      }
View Full Code Here

    assertEquals(2, status.getResponse().size());
    for (Response r : status.getResponse())
    {
      assertNotNull(r.getPropstat());
      assertFalse(r.getPropstat().isEmpty());
      assertTrue(new DavResource(r).isDirectory());
    }
  }
View Full Code Here

    @FixFor( "MODE-984" )
    public void shouldRetrieveFolderCustomProperties() throws Exception {
        String folderUri = resourceUri(testFolder());
        sardine.createDirectory(folderUri);

        DavResource resource = sardine.getResources(folderUri).get(0);
        Map<String, String> customProperties = resource.getCustomProps();
        assertTrue(!customProperties.isEmpty());
        assertEquals("nt:folder", customProperties.get("primaryType"));
        assertNotNull(customProperties.get("created"));
        assertNotNull(customProperties.get("createdBy"));
    }
View Full Code Here

        byte[] binaryData = new byte[1024];
        new Random().nextBytes(binaryData);
        String fileUri = testFile(folderUri);
        sardine.put(fileUri, new ByteArrayInputStream(binaryData), "application/octet-stream");

        DavResource resource = sardine.getResources(fileUri).get(0);
        Map<String, String> customProperties = resource.getCustomProps();
        assertTrue(!customProperties.isEmpty());
        assertEquals("nt:file", customProperties.get("primaryType"));
        assertNotNull(customProperties.get("created"));
        assertNotNull(customProperties.get("createdBy"));
    }
View Full Code Here

        Map<String, String> customProps = new HashMap<String, String>();
        customProps.put("myProp", "myValue");
        sardine.setCustomProps(fileUri, customProps, null);

        DavResource resource = sardine.getResources(fileUri).get(0);
        Map<String, String> customProperties = resource.getCustomProps();
        assertTrue(!customProperties.isEmpty());
        assertFalse(customProperties.containsKey("myProp"));
    }
View Full Code Here

        sardine.createDirectory(folderUri);

        Map<String, String> customProps = new HashMap<String, String>();
        customProps.put("myProp", "myValue");
        sardine.setCustomProps(folderUri, customProps, null);
        DavResource resource = sardine.getResources(folderUri).get(0);
        Map<String, String> customProperties = resource.getCustomProps();
        assertTrue(!customProperties.isEmpty());
        assertFalse(customProperties.containsKey("myProp"));
    }
View Full Code Here

    @Test
    @FixFor( "MODE-2010" )
    public void shouldIgnoreMultiValuedProperties() throws Exception {
        //created via initial content
        String nodeUri = resourceUri("node");
        DavResource resource = sardine.getResources(nodeUri).get(0);
        Map<String, String> customProperties = resource.getCustomProps();
        assertTrue(!customProperties.isEmpty());
        assertEquals("value", customProperties.get("single-value-prop"));
    }
View Full Code Here

    @Test
    @FixFor( "MODE-2243" )
    public void shouldEscapeIllegalCharsInXMLValues() throws Exception {
        //created via initial content
        String folderUri = resourceUri("folder");
        DavResource folder = sardine.getResources(folderUri).get(0);
        Map<String, String> customProperties = folder.getCustomProps();
        assertTrue(!customProperties.isEmpty());
        assertEquals("nt:folder", customProperties.get("primaryType"));
        //nt:folder has a created mixin which will auto-set the next 2 props
        assertNotNull(customProperties.get("created"));
        assertEquals("<modeshape-worker>", customProperties.get("createdBy"));
View Full Code Here

        sardine.createDirectory(folderUri);
        String fileUri = testFile(folderUri);

        sardine.put(fileUri, new ByteArrayInputStream(binaryData), "application/octet-stream");
        assertTrue(sardine.exists(fileUri));
        DavResource file = getResourceAtURI(fileUri);

        assertEquals(binarySize, file.getContentLength().intValue());
    }
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.