directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r331733 - /directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
Date Tue, 08 Nov 2005 08:32:32 GMT
Author: akarasulu
Date: Tue Nov  8 00:32:28 2005
New Revision: 331733

URL: http://svn.apache.org/viewcvs?rev=331733&view=rev
Log:
fixed bug with ldif loader

Modified:
    directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java

Modified: directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java?rev=331733&r1=331732&r2=331733&view=diff
==============================================================================
--- directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
Tue Nov  8 00:32:28 2005
@@ -24,11 +24,14 @@
 import java.util.Hashtable;
 import java.util.Iterator;
 
+import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.Context;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.kerberos.kdc.KdcConfiguration;
 import org.apache.kerberos.kdc.KerberosServer;
@@ -48,6 +51,7 @@
 import org.apache.protocol.common.store.LdifFileLoader;
 import org.apache.changepw.ChangePasswordServer;
 import org.apache.changepw.ChangePasswordConfiguration;
+import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -220,7 +224,7 @@
 
     private Attributes getLdifFileEntry( DirContext root, File ldif ) throws NamingException
     {
-        String rdnAttr = File.pathSeparatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
+        String rdnAttr = File.separatorChar == '\\' ? WINDOWSFILE_ATTR : UNIXFILE_ATTR;
         StringBuffer buf = new StringBuffer();
         buf.append( rdnAttr );
         buf.append( "=" );
@@ -251,7 +255,8 @@
             log.error( "could not get canonical path", e );
             return null;
         }
-        return canonical;
+        
+        return StringUtils.replace( canonical, "\\", "\\\\" );
     }
 
 



Mime
View raw message