out.printf("%s<cache policy=\"%s\"/>\n", indent, StringEscapeUtils.escapeXml(cp.getName()));
}
private void writeAuthenticator(PrintWriter out)
{
Authenticator auth = cfg.getAuthenticator();
for (String user : auth.getUsers())
{
String pass = auth.getPassword(user);
String passattr = pass == null ? "" : String.format(" password=\"%s\"", pass);
out.printf("\t<user name=\"%s\"%s/>\n", user, passattr);
}
for (String group : auth.getGroups())
{
out.printf("\t<group name=\"%s\">\n", group);
for (String user : auth.getGroupMembers(group))
out.printf("\t\t<member name=\"%s\"/>\n", user);
out.printf("\t</group>\n", group);
}
for (String path : auth.getPaths()) {
out.printf("\t<scope path=\"%s\"", StringEscapeUtils.escapeXml(path));
Set<String> groups = auth.getAuthorizedGroups(path);
if (groups == null)
out.println("/>");
else
{
out.println(">");