You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2005/11/08 09:32:32 UTC
svn commit: r331733 -
/directory/apacheds/trunk/server/src/main/java/org/apache/ldap/server/jndi/ServerContextFactory.java
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, "\\", "\\\\" );
}