Package net.sf.pipet.api

Examples of net.sf.pipet.api.Authenticator


    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(">");
View Full Code Here


    if (nodes == null || nodes.getLength() == 0)
      return;

    Element elem = (Element)nodes.item(0);

    Authenticator auth = new AuthenticatorImpl();
    parseGroups(auth, elem);
    parseUsers(auth, elem);
    parseAllow(auth, "/", elem);
    cfg.setAuthenticator(auth);
  }
View Full Code Here

TOP

Related Classes of net.sf.pipet.api.Authenticator

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.