X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=blobdiff_plain;f=org.argeo.enterprise%2Fsrc%2Forg%2Fargeo%2Fnaming%2FLdifParser.java;h=cc19570588f2eb9c9dcc19f124e28fe0d30444e8;hp=86392b345174cb9392a1cb5360fe439470e777b4;hb=438237c2b8c995d4f9562d53bfe4ea63c4442054;hpb=9885228c89ca6da1835c1c3e098c92589d76301e diff --git a/org.argeo.enterprise/src/org/argeo/naming/LdifParser.java b/org.argeo.enterprise/src/org/argeo/naming/LdifParser.java index 86392b345..cc1957058 100644 --- a/org.argeo.enterprise/src/org/argeo/naming/LdifParser.java +++ b/org.argeo.enterprise/src/org/argeo/naming/LdifParser.java @@ -22,13 +22,10 @@ import javax.naming.directory.BasicAttributes; import javax.naming.ldap.LdapName; import javax.naming.ldap.Rdn; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.argeo.osgi.useradmin.UserDirectoryException; /** Basic LDIF parser. */ public class LdifParser { - private final static Log log = LogFactory.getLog(LdifParser.class); private final static Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; protected Attributes addAttributes(SortedMap res, int lineNumber, LdapName currentDn, @@ -43,8 +40,6 @@ public class LdifParser { "Attribute " + nameAttr.getID() + "=" + nameAttr.get() + " not consistent with DN " + currentDn + " (shortly before line " + lineNumber + " in LDIF file)"); Attributes previous = res.put(currentDn, currentAttributes); - if (log.isTraceEnabled()) - log.trace("Added " + currentDn); return previous; } catch (NamingException e) { throw new UserDirectoryException("Cannot add " + currentDn, e); @@ -59,8 +54,7 @@ public class LdifParser { try { in.close(); } catch (IOException e) { - if (log.isTraceEnabled()) - log.error("Cannot close stream", e); + // silent } } } @@ -126,8 +120,8 @@ public class LdifParser { // Attributes previous = addAttributes(res, lineNumber, currentDn, currentAttributes); if (previous != null) { - log.warn("There was already an entry with DN " + currentDn - + ", which has been discarded by a subsequent one."); +// log.warn("There was already an entry with DN " + currentDn +// + ", which has been discarded by a subsequent one."); } } @@ -136,7 +130,7 @@ public class LdifParser { currentDn = new LdapName(attributeValue.toString()); currentAttributes = new BasicAttributes(true); } catch (InvalidNameException e) { - log.error(attributeValue + " not a valid DN, skipping the entry."); +// log.error(attributeValue + " not a valid DN, skipping the entry."); currentDn = null; currentAttributes = null; } @@ -159,8 +153,7 @@ public class LdifParser { try { reader.close(); } catch (IOException e) { - if (log.isTraceEnabled()) - log.error("Cannot close stream", e); + // silent } } return res;