Package com.github.sardine.model

Examples of com.github.sardine.model.Multistatus


    protected List<DavResource> list(String url, int depth, Propfind body) throws IOException
    {
        HttpPropFind entity = new HttpPropFind(url);
        entity.setDepth(Integer.toString(depth));
        entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
        Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
        List<Response> responses = multistatus.getResponse();
        List<DavResource> resources = new ArrayList<DavResource>(responses.size());
    for (Response response : responses)
    {
      try
      {
View Full Code Here


  {
    HttpEntityEnclosingRequestBase search = new HttpSearch(url);
    SearchRequest searchBody = new SearchRequest(language, query);
    String body = SardineUtil.toXml(searchBody);
    search.setEntity(new StringEntity(body, UTF_8));
    Multistatus multistatus = this.execute(search, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    List<DavResource> resources = new ArrayList<DavResource>(responses.size());
    for (Response response : responses)
    {
      try
      {
View Full Code Here

        any.add(element);
      }
      remove.setProp(prop);
    }
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    List<DavResource> resources = new ArrayList<DavResource>(responses.size());
    for (Response response : responses)
    {
      try
      {
View Full Code Here

    prop.setOwner(new Owner());
    prop.setGroup(new Group());
    prop.setAcl(new Acl());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
    {
      return null;
    }
    else
View Full Code Here

    Prop prop = new Prop();
    prop.setQuotaAvailableBytes(new QuotaAvailableBytes());
    prop.setQuotaUsedBytes(new QuotaUsedBytes());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
    {
      return null;
    }
    else
View Full Code Here

    prop.setDisplayname(new Displayname());
    prop.setResourcetype(new Resourcetype());
    prop.setPrincipalURL(new PrincipalURL());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
    {
      return null;
    }
    else
View Full Code Here

    Propfind body = new Propfind();
    Prop prop = new Prop();
    prop.setPrincipalCollectionSet(new PrincipalCollectionSet());
    body.setProp(prop);
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    Multistatus multistatus = this.execute(entity, new MultiStatusResponseHandler());
    List<Response> responses = multistatus.getResponse();
    if (responses.isEmpty())
    {
      return null;
    }
    else
View Full Code Here

        "<D:multistatus xmlns:D=\"DAV:\" xmlns:ns0=\"urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/\">" +
        "<D:response>" +
        "<D:href>http://server.local/dav/</D:href>" +
        "</D:response>" +
        "</D:multistatus>";
    final Multistatus status = handler.getMultistatus(new ByteArrayInputStream(response.getBytes()));
    assertNotNull(status);
    assertEquals(1, status.getResponse().size());
  }
View Full Code Here

        "   <d:status>HTTP/1.1 200 OK</d:status>" +
        "  </d:propstat>" +
        " </d:response>" +
        "</d:multistatus>";
    MultiStatusResponseHandler handler = new MultiStatusResponseHandler();
    Multistatus status = handler.getMultistatus(new ByteArrayInputStream(response.getBytes()));
    assertNotNull(status);
    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

        "   </D:prop>" +
        "   <D:status>HTTP/1.1 200 OK</D:status>" +
        "  </D:propstat>" +
        " </D:response>" +
        "</D:multistatus>";
    final Multistatus status = handler.getMultistatus(new ByteArrayInputStream(response.getBytes()));
    assertNotNull(status);
    assertEquals(12, status.getResponse().size());
  }
View Full Code Here

TOP

Related Classes of com.github.sardine.model.Multistatus

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.