FileUtils.deleteDirectory( schemaRepository );
SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor( new File( workingDirectory ) );
extractor.extractOrCopy( true );
loader = new LdifSchemaLoader( schemaRepository );
SchemaManager schemaManager = new DefaultSchemaManager( loader );
schemaManager.loadAllEnabled();
List<Throwable> errors = schemaManager.getErrors();
if ( errors.size() != 0 )
{
// We have inconsistencies : log them and exit.
throw new RuntimeException( "Inconsistent schemas : " +
ExceptionUtils.printErrors( errors ) );
}
atCN = schemaManager.lookupAttributeTypeRegistry( "cn" );
atC = schemaManager.lookupAttributeTypeRegistry( "c" );
atSN = schemaManager.lookupAttributeTypeRegistry( "sn" );
atPwd = schemaManager.lookupAttributeTypeRegistry( "userpassword" );
}