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;
}