You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Felix Knecht (JIRA)" <ji...@apache.org> on 2010/09/28 15:04:33 UTC

[jira] Updated: (DIRSERVER-1560) ldif files not sorted in alphabetical order on Linux

     [ https://issues.apache.org/jira/browse/DIRSERVER-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Knecht updated DIRSERVER-1560:
------------------------------------

    Attachment: ldif-alphabetic-order.patch

Patch for alphabetic ordering. I don't commit it as I'm not able to test it, sorry.

Hope that anybody with more knowledge can test (and when ok commit) it.
Felix

> ldif files not sorted in alphabetical order on Linux
> ----------------------------------------------------
>
>                 Key: DIRSERVER-1560
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-1560
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.7
>         Environment: CentOS - Linux
>            Reporter: Carsten Kaiser
>         Attachments: ldif-alphabetic-order.patch
>
>
> 	Von: 	Kiran Ayyagari <ka...@apache.org>
> 	Betreff: 	Re: Problem with sorting of ldif files on Linux
> 	Datum: 	28. September 2010 12:51:36 MESZ
> 	An: 	users@directory.apache.org
> 	Kopie: 	Sven Baum <sv...@valtech.de>
> 	Antwort an: 	users@directory.apache.org
> Hi there,
> we are using ApacheDS respectively the Maven ApacheDS Plugin to run our integration tests against a clean LDAP server instance and therefore populate
> it with the according schema information and setup data on test startup. We have different ldif files for schema and setup data especially named in alphabetical order
> to ensure, that the schema information is loaded before the setup data. Although this works fine for e.g. on MacOSX it does not work on Linux due to the following
> Code Snippet from class org.apache.directory.server.configuration.ApacheDS
> else
> {
>     // get all the ldif files within the directory (should be sorted alphabetically)
>    File[] ldifFiles = ldifDirectory.listFiles( new FileFilter()
>    { 
>        public boolean accept( File pathname )
>        {
>              boolean isLdif = pathname.getName().toLowerCase().endsWith( ".ldif" );
>              return pathname.isFile() && pathname.canRead() && isLdif;
>        }
>     } );
> According to Javadoc of class java.io.File
> Returns an array of abstract pathnames denoting the files in the directory denoted by this abstract pathname.
> If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of File objects is returned, one for each file or directory in the directory. Pathnames denoting the directory itself and the directory's parent directory are not included in the result. Each resulting abstract pathname is constructed from this abstract pathname using the File(File, String) constructor. Therefore if this pathname is absolute then each resulting pathname is absolute; if this pathname is relative then each resulting pathname will be relative to the same directory.
> -> There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
> the assumption stated in the code snippet above is not valid and depends on the platform resp. Java implementation.
> In order to be platform independent the retrieved array of ldif files should be sorted in alphabetical order explicitly after retrieval.
> so you want them in a sorted order right, can you create a JIRA for this, will fix it
> Since I'm not a committer could someone please provide a patch for this problem?
> When will the next version of the maven ApacheDS plugin be available depending on the most current ApacheDS version (hopefully including a fix for this problem)? Currently it refers to 1.5.5...
> this is not a official plugin from Apache Directory Project, so can't say when it gets updated 
> Kind regards,
> CAK 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.