Package com.googlecode.sardine

Examples of com.googlecode.sardine.DavAcl


    {
      return null;
    }
    else
    {
      return new DavAcl(responses.get(0));
    }
  }
View Full Code Here


      assertNotNull(status);
      assertEquals(1, status.getResponse().size());
      Response r = status.getResponse().get(0);
      assertNotNull(r.getPropstat());
      assertFalse(r.getPropstat().isEmpty());
      DavAcl davAcl = new DavAcl(r);
      assertNotNull("Query should give a owner name " + response, davAcl.getOwner());
      assertEquals("Query should give us group name", "/group/somegroup", davAcl.getGroup());
      assertNotNull("Query should result in an existing ACL", davAcl.getAces());
      // check ACEs decoding
      assertEquals(5, davAcl.getAces().size());
      assertEquals("read", davAcl.getAces().get(0).getGranted().get(0));
      assertEquals("write", davAcl.getAces().get(0).getGranted().get(1));
      assertEquals("write-properties", davAcl.getAces().get(0).getGranted().get(2));
      assertEquals("all", davAcl.getAces().get(1).getDenied().get(0));
      //property ACLs should be handled
      assertEquals(DavPrincipal.PrincipalType.PROPERTY,davAcl.getAces().get(0).getPrincipal().getPrincipalType());
      assertEquals(new QName("DAV:", "owner"), davAcl.getAces().get(0).getPrincipal().getProperty());
      //href ACLs should be handled
      assertEquals(DavPrincipal.PrincipalType.HREF,davAcl.getAces().get(3).getPrincipal().getPrincipalType());
      assertEquals("/some/user", davAcl.getAces().get(3).getPrincipal().getValue());
      //key acl should be supported
      assertEquals(DavPrincipal.PrincipalType.KEY,davAcl.getAces().get(4).getPrincipal().getPrincipalType());
      assertEquals("all",davAcl.getAces().get(4).getPrincipal().getValue());     
      // inheritance ACLs
      assertEquals("/", davAcl.getAces().get(0).getInherited());
      // protected acls
      assertTrue(davAcl.getAces().get(4).isProtected());
    }
  }
View Full Code Here

TOP

Related Classes of com.googlecode.sardine.DavAcl

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.