diff --git a/core/src/main/java/org/springframework/security/config/ApacheDSContainer.java b/core/src/main/java/org/springframework/security/config/ApacheDSContainer.java index 8c01f7599d..7fd117d133 100644 --- a/core/src/main/java/org/springframework/security/config/ApacheDSContainer.java +++ b/core/src/main/java/org/springframework/security/config/ApacheDSContainer.java @@ -61,17 +61,15 @@ class ApacheDSContainer implements InitializingBean, DisposableBean, Lifecycle, } public void afterPropertiesSet() throws Exception { - if (workingDir != null) { - return; - } + if (workingDir == null) { + String apacheWorkDir = System.getProperty("apacheDSWorkDir"); - String apacheWorkDir = System.getProperty("apacheDSWorkDir"); + if (apacheWorkDir == null) { + apacheWorkDir = System.getProperty("java.io.tmpdir") + File.separator + "apacheds-spring-security"; + } - if (apacheWorkDir == null) { - apacheWorkDir = System.getProperty("java.io.tmpdir") + File.separator + "apacheds-spring-security"; + setWorkingDirectory(new File(apacheWorkDir)); } - - setWorkingDirectory(new File(apacheWorkDir)); start(); }