directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1028909 - in /directory/apacheds/branches/apacheds-config: core-annotations/src/main/java/org/apache/directory/server/core/factory/ core/src/main/java/org/apache/directory/server/core/
Date Fri, 29 Oct 2010 21:27:48 GMT
Author: elecharny
Date: Fri Oct 29 21:27:48 2010
New Revision: 1028909

URL: http://svn.apache.org/viewvc?rev=1028909&view=rev
Log:
o Created the default directories when the DirectoryService is created

Modified:
    directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java

Modified: directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?rev=1028909&r1=1028908&r2=1028909&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
(original)
+++ directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
Fri Oct 29 21:27:48 2010
@@ -22,7 +22,6 @@ package org.apache.directory.server.core
 import java.io.File;
 import java.util.List;
 
-import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
@@ -209,9 +208,6 @@ public class DefaultDirectoryServiceFact
         // Erase the working directory to be sure that we don't have some
         // remaining data from a previous run
         String workingDirectoryPath = directoryService.getInstanceLayout().getInstanceDirectory().getPath();
-        File workingDirectory = new File( workingDirectoryPath );
-
-        FileUtils.deleteDirectory( workingDirectory );
 
         // Init the service now
         initSchema();

Modified: directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1028909&r1=1028908&r2=1028909&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Fri Oct 29 21:27:48 2010
@@ -509,6 +509,32 @@ public class DefaultDirectoryService imp
     public void setInstanceLayout( InstanceLayout instanceLayout )
     {
         this.instanceLayout = instanceLayout;
+        
+        // Create the directories if they are missing
+        if ( !instanceLayout.getInstanceDirectory().exists() )
+        {
+            instanceLayout.getInstanceDirectory().mkdirs();
+        }
+
+        if ( !instanceLayout.getLogDirectory().exists() )
+        {
+            instanceLayout.getLogDirectory().mkdirs();
+        }
+        
+        if ( !instanceLayout.getRunDirectory().exists() )
+        {
+            instanceLayout.getRunDirectory().mkdirs();
+        }
+        
+        if ( !instanceLayout.getPartitionsDirectory().exists() )
+        {
+            instanceLayout.getPartitionsDirectory().mkdirs();
+        }
+        
+        if ( !instanceLayout.getConfDirectory().exists() )
+        {
+            instanceLayout.getConfDirectory().mkdirs();
+        }
     }
 
 



Mime
View raw message