From 7c30dbb5403772b323df3ad907d9ed15d23b5aee Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Thu, 29 Apr 2010 20:35:40 +0000
Subject: [PATCH] Last batch of changes for this week. This adds support for the IETF based Password Policy for LDAP as SubEntry. Also resolves the following issues : - 4544 :  initializeBackend() should not set JE env config params directly. - 4478 : ECL in draft compat mode / search lastchangenumber can be very long - 4538 : Virtual attributes not retrieved when entry cache configured - 4547 : Search Filter Matching differ for cn=Directory Manager and plain user. - 4514 : Logs shows unexpected message with replication monitoring data missing (Partial fix) - 4534 : Replication using security does not work after server restart - 4516 : SEVERE_ERROR: servers (...) have the same ServerId In addition, they also improve reliability and performance in various areas including CollectiveAttributes, Virtual Attributes and Subentries management, Schema loading, Replication...

---
 opends/src/server/org/opends/server/core/SchemaConfigManager.java |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/SchemaConfigManager.java b/opends/src/server/org/opends/server/core/SchemaConfigManager.java
index 186a1bd..82dac13 100644
--- a/opends/src/server/org/opends/server/core/SchemaConfigManager.java
+++ b/opends/src/server/org/opends/server/core/SchemaConfigManager.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2006-2009 Sun Microsystems, Inc.
+ *      Copyright 2006-2010 Sun Microsystems, Inc.
  */
 package org.opends.server.core;
 import org.opends.messages.Message;
@@ -30,6 +30,7 @@
 
 
 import java.io.File;
+import java.io.FilenameFilter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.LinkedList;
@@ -187,6 +188,26 @@
 
 
   /**
+   * Filter implementation that accepts only ldif files.
+   */
+  private class SchemaFileFilter implements FilenameFilter
+  {
+    /**
+     * {@inheritDoc}
+     */
+    public boolean accept(File directory, String filename)
+    {
+      if (filename.endsWith(".ldif"))
+      {
+        return true;
+      }
+      return false;
+    }
+  }
+
+
+
+  /**
    * Initializes all the attribute type, object class, name form, DIT content
    * rule, DIT structure rule, and matching rule use definitions by reading the
    * server schema files.  These files will be located in a single directory and
@@ -253,12 +274,15 @@
         schemaInstanceDir = null;
       }
 
-      File[] schemaInstallDirFiles  = schemaInstallDir.listFiles() ;
+      FilenameFilter filter = new SchemaFileFilter();
+      File[] schemaInstallDirFiles =
+              schemaInstallDir.listFiles(filter);
       int fileNumber = schemaInstallDirFiles.length;
       File[] schemaInstanceDirFiles = null ;
       if (schemaInstanceDir != null)
       {
-        schemaInstanceDirFiles = schemaInstanceDir.listFiles();
+        schemaInstanceDirFiles =
+                schemaInstanceDir.listFiles(filter);
         fileNumber =+ schemaInstanceDirFiles.length ;
       }
 

--
Gitblit v1.10.0