You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/09/28 16:24:23 UTC
svn commit: r1002176 -
/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
Author: kayyagari
Date: Tue Sep 28 14:24:23 2010
New Revision: 1002176
URL: http://svn.apache.org/viewvc?rev=1002176&view=rev
Log:
o committed the patch for DIRSERVER-1560 provided by Felix, thank you
Modified:
directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java?rev=1002176&r1=1002175&r2=1002176&view=diff
==============================================================================
--- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java (original)
+++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java Tue Sep 28 14:24:23 2010
@@ -24,6 +24,8 @@ import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.List;
import java.util.Set;
@@ -369,7 +371,7 @@ public class ApacheDS
/**
- * Load the ldif files if there are some
+ * Load the existing LDIF files in alphabetic order
*/
public void loadLdifs() throws Exception
{
@@ -416,7 +418,7 @@ public class ApacheDS
}
else
{
- // get all the ldif files within the directory (should be sorted alphabetically)
+ // get all the ldif files within the directory
File[] ldifFiles = ldifDirectory.listFiles( new FileFilter()
{
public boolean accept( File pathname )
@@ -433,7 +435,16 @@ public class ApacheDS
getCanonical( ldifDirectory ) );
return;
}
-
+
+ // Sort ldifFiles in alphabetic order
+ Arrays.sort( ldifFiles, new Comparator<File>()
+ {
+ public int compare( File f1, File f2)
+ {
+ return f1.getName().compareTo( f2 .getName() );
+ }
+ });
+
// load all the ldif files and load each one that is loaded
for ( File ldifFile : ldifFiles )
{