mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
SEC-1652: Use a URI for resolving the LDIF file for loading in ApacheDS container to allow for loading files which are contained in a jar.
This commit is contained in:
parent
3f7f87e19f
commit
66e2a5246d
@ -1,6 +1,7 @@
|
|||||||
package org.springframework.security.ldap.server;
|
package org.springframework.security.ldap.server;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -226,12 +227,12 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Note that we can't just import using the ServerContext returned
|
// Note that we can't just import using the ServerContext returned
|
||||||
// from starting Apace DS, apparently because of the long-running issue DIRSERVER-169.
|
// from starting Apache DS, apparently because of the long-running issue DIRSERVER-169.
|
||||||
// We need a standard context.
|
// We need a standard context.
|
||||||
//DirContext dirContext = contextSource.getReadWriteContext();
|
//DirContext dirContext = contextSource.getReadWriteContext();
|
||||||
|
|
||||||
if(ldifs != null && ldifs.length > 0) {
|
if(ldifs != null && ldifs.length > 0) {
|
||||||
String ldifFile = ldifs[0].getFile().getAbsolutePath();
|
String ldifFile = ldifs[0].getURI().toString();
|
||||||
logger.info("Loading LDIF file: " + ldifFile);
|
logger.info("Loading LDIF file: " + ldifFile);
|
||||||
LdifFileLoader loader = new LdifFileLoader(service.getAdminSession(), ldifFile);
|
LdifFileLoader loader = new LdifFileLoader(service.getAdminSession(), ldifFile);
|
||||||
loader.execute();
|
loader.execute();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user