List<LdifEntry> entries = parseLdif( reader );
new FileInputStream( file ), Charset.forName( encoding ) ) ); return parseLdif( reader );
/** * Inject an ldif String into the server. DN must be relative to the root. * * @param ldif the entries to inject * @throws NamingException if the entries cannot be added */ protected void injectEntries( String ldif ) throws Exception { LdifReader reader = new LdifReader(); List<LdifEntry> entries = reader.parseLdif( ldif ); for ( LdifEntry entry : entries ) { rootDSE.add( new DefaultServerEntry( rootDSE.getDirectoryService().getRegistries(), entry.getEntry() ) ); } }
/** * Inject an ldif String into the server. DN must be relative to the * root. * @param ldif the entries to inject * @throws NamingException if the entries cannot be added */ protected void injectEntries( String ldif ) throws Exception { LdifReader reader = new LdifReader(); List<LdifEntry> entries = reader.parseLdif( ldif ); for ( LdifEntry entry : entries ) { rootDSE.add( new DefaultServerEntry( rootDSE.getDirectoryService().getRegistries(), entry.getEntry() ) ); } } }