directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r989126 - /directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SingleLdifSchemaLoader.java
Date Wed, 25 Aug 2010 14:17:26 GMT
Author: kayyagari
Date: Wed Aug 25 14:17:25 2010
New Revision: 989126

URL: http://svn.apache.org/viewvc?rev=989126&view=rev
Log:
o fixed the regex pattern to consider white spaces

Modified:
    directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SingleLdifSchemaLoader.java

Modified: directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SingleLdifSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SingleLdifSchemaLoader.java?rev=989126&r1=989125&r2=989126&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SingleLdifSchemaLoader.java
(original)
+++ directory/shared/trunk/ldap-schema-loader/src/main/java/org/apache/directory/shared/ldap/schema/loader/ldif/SingleLdifSchemaLoader.java
Wed Aug 25 14:17:25 2010
@@ -85,7 +85,7 @@ public class SingleLdifSchemaLoader exte
 
     private void initializeSchemas( InputStream in ) throws Exception
     {
-        Pattern schemaStartPattern = Pattern.compile( "cn=[a-z0-9-_]*\\s*,\\s*ou\\s*=\\s*schema"
);
+        Pattern schemaStartPattern = Pattern.compile( "cn\\s*=\\s*[a-z0-9-_]*\\s*,\\s*ou\\s*=\\s*schema"
);
 
         LdifReader ldifReader = new LdifReader( in );
 
@@ -116,8 +116,8 @@ public class SingleLdifSchemaLoader exte
     {
         for ( String scObjTypeRdn : schemaObjectTypeRdns )
         {
-            Pattern regex = Pattern.compile( "m-oid=[0-9\\.]*" + ",ou=" + scObjTypeRdn +
",cn=" + schemaName
-                + ",ou=schema", Pattern.CASE_INSENSITIVE );
+            Pattern regex = Pattern.compile( "m-oid\\s*=\\s*[0-9\\.]*\\s*" + ",\\s*ou\\s*=\\s*"
+ scObjTypeRdn + "\\s*,\\s*cn\\s*=\\s*" + schemaName
+                + "\\s*,\\s*ou=schema\\s*", Pattern.CASE_INSENSITIVE );
 
             String dn = ldifEntry.getDn().getName();
 



Mime
View raw message