private void writeUserRegistry(LocalContainer container,File configDir,Map<String,String> users,Map<String,List<String>> groups) throws IOException {
  File usersXML=new File(configDir,"cargo-users.xml");
  PrintStream writer=ServerConfigUtils.open(usersXML);
  writer.println("  <basicRegistry id=\"basic\">");
  for (  Map.Entry<String,String> user : users.entrySet()) {
    writer.print("    <user name=\"");
    writer.print(user.getKey());
    writer.print("\" password=\"");
    writer.print(user.getValue());
    writer.println("\"/>");
  }
  for (  Map.Entry<String,List<String>> group : groups.entrySet()) {
    writer.print("    <group name=\"");
    writer.print(group.getKey());
    writer.println("\">");
    for (    String member : group.getValue()) {
      writer.print("      <member name=\"");
      writer.print(member);
      writer.println("\"/>");
    }
    writer.println("    </group>");
  }
  writer.println("  </basicRegistry>");
  ServerConfigUtils.close(writer);
}

private void writeUserRegistry ( LocalContainer container , File configDir , Map < String , String > users , Map < String , List < String > > groups ) throws IOException { File usersXML = new File ( configDir , "cargo-users.xml" ) ; PrintStream writer = ServerConfigUtils . open ( usersXML ) ; writer . println ( "  <basicRegistry id=\"basic\">" ) ; for ( Map . Entry < String , String > user : users . entrySet ( ) ) { writer . print ( "    <user name=\"" ) ; writer . print ( user . getKey ( ) ) ; writer . print ( "\" password=\"" ) ; writer . print ( user . getValue ( ) ) ; writer . println ( "\"/>" ) ; } for ( Map . Entry < String , List < String > > group : groups . entrySet ( ) ) { writer . print ( "    <group name=\"" ) ; writer . print ( group . getKey ( ) ) ; writer . println ( "\">" ) ; for ( String member : group . getValue ( ) ) { writer . print ( "      <member name=\"" ) ; writer . print ( member ) ; writer . println ( "\"/>" ) ; } writer . println ( "    </group>" ) ; } writer . println ( "  </basicRegistry>" ) ; ServerConfigUtils . close ( writer ) ; }
this method writes a user registry xml
