mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
SEC-1652: Only use URI for ldif path if file isn't found.
This commit is contained in:
parent
3fe49dfae5
commit
bd7389b6ff
@ -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.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -232,7 +233,13 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
|
|||||||
//DirContext dirContext = contextSource.getReadWriteContext();
|
//DirContext dirContext = contextSource.getReadWriteContext();
|
||||||
|
|
||||||
if(ldifs != null && ldifs.length > 0) {
|
if(ldifs != null && ldifs.length > 0) {
|
||||||
String ldifFile = ldifs[0].getURI().toString();
|
String ldifFile;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ldifFile = ldifs[0].getFile().getAbsolutePath();
|
||||||
|
} catch (IOException e) {
|
||||||
|
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