XMLPrinter.OPENING);
Enumeration aceList = aces.elements();
while (aceList.hasMoreElements()) {
Ace ace = (Ace) aceList.nextElement();
printer.writeElement("D", null, "ace",
XMLPrinter.OPENING);
printer.writeElement("D", null, "principal",
XMLPrinter.OPENING);
boolean found=false;
String principal=ace.getPrincipal();
String[] types={"all","authenticated","unauthenticated","property","self"};
for (int i=0; i<types.length && found==false; i++)
{
if (types[i].equals(principal)) {
found=true;
printer.writeElement("D",null,principal, XMLPrinter.NO_CONTENT);
}
}
if (!found)
{
printer.writeElement("D", null, "href", XMLPrinter.OPENING);
printer.writeText(ace.getPrincipal());
printer.writeElement("D", null, "href", XMLPrinter.CLOSING);
}
printer.writeElement("D", null, "principal",
XMLPrinter.CLOSING);
String positive = (ace.isNegative()) ? "deny" : "grant";
printer.writeElement("D", null, positive,
XMLPrinter.OPENING);
Enumeration privilegeList = ace.enumeratePrivileges();
while (privilegeList.hasMoreElements()) {
Privilege privilege = (Privilege) privilegeList.nextElement();
printer.writeElement("D", null, "privilege",
XMLPrinter.OPENING);
printer.writeElement(null,privilege.getNamespace(),privilege.getName(), XMLPrinter.NO_CONTENT);
printer.writeElement("D", null, "privilege",
XMLPrinter.CLOSING);
}
printer.writeElement("D", null, positive,
XMLPrinter.CLOSING);
if (ace.isInherited()) {
printer.writeElement("D", null, "inherited",
XMLPrinter.NO_CONTENT);
}
printer.writeElement("D", null, "ace",