Proper LDIF backend for deploy configs.
[lgpl/argeo-commons.git] / org.argeo.security.core / src / org / argeo / util / naming / LdifWriter.java
index 76586c3b3efa980cc2cbeb7d93ffa3f9996057dc..56f3224761952e1faed312afac32b7d1c3190ded 100644 (file)
@@ -6,6 +6,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
+import java.util.Map;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
@@ -57,6 +58,11 @@ public class LdifWriter {
                }
        }
 
+       public void write(Map<LdapName, Attributes> entries) throws IOException {
+               for (LdapName dn : entries.keySet())
+                       writeEntry(dn, entries.get(dn));
+       }
+
        protected void writeAttribute(Attribute attribute) throws NamingException, IOException {
                for (NamingEnumeration<?> attrValues = attribute.getAll(); attrValues.hasMore();) {
                        Object value = attrValues.next();