Package com.github.sardine.model

Examples of com.github.sardine.model.Ace


    return isprotected;
  }

  public Ace toModel()
  {
    Ace ace = new Ace();
    Principal p = new Principal();
    switch (principal.getPrincipalType())
    {
      case HREF:
        p.setHref(principal.getValue());
        break;
      case PROPERTY:
        p.setProperty(new Property());
        p.getProperty().setProperty(SardineUtil.createElement(principal.getProperty()));
        break;
      case KEY:
        if (DavPrincipal.KEY_ALL.equals(principal.getValue()))
        {
          p.setAll(new All());
        }
        else if (DavPrincipal.KEY_AUTHENTICATED.equals(principal.getValue()))
        {
          p.setAuthenticated(new Authenticated());
        }
        else if (DavPrincipal.KEY_UNAUTHENTICATED.equals(principal.getValue()))
        {
          p.setUnauthenticated(new Unauthenticated());
        }
        else if (DavPrincipal.KEY_SELF.equals(principal.getValue()))
        {
          p.setSelf(new Self());
        }
    }
    ace.setPrincipal(p);
    if (granted != null && granted.size() > 0)
    {
      ace.setGrant(new Grant());
      ace.getGrant().setPrivilege(toPrivilege(granted));
    }
    if (denied != null && denied.size() > 0)
    {
      ace.setDeny(new Deny());
      ace.getDeny().setPrivilege(toPrivilege(denied));
    }
    return ace;
  }
View Full Code Here


      // protected and inherited acl must not be part of ACL http request
      if (davAce.getInherited() != null || davAce.isProtected())
      {
        continue;
      }
      Ace ace = davAce.toModel();
      body.getAce().add(ace);
    }
    entity.setEntity(new StringEntity(SardineUtil.toXml(body), UTF_8));
    this.execute(entity, new VoidResponseHandler());
  }
View Full Code Here

TOP

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

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.