incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r652624 - /incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/Activator.java
Date Thu, 01 May 2008 18:58:34 GMT
Author: fmeschbe
Date: Thu May  1 11:58:33 2008
New Revision: 652624

URL: http://svn.apache.org/viewvc?rev=652624&view=rev
Log:
SLING-407 Use the current working directory as the parent for the repository
folder if sling.home is not set

Modified:
    incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/Activator.java

Modified: incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/Activator.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/Activator.java?rev=652624&r1=652623&r2=652624&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/Activator.java
(original)
+++ incubator/sling/trunk/jcr/jackrabbit-server/src/main/java/org/apache/sling/jcr/jackrabbit/server/Activator.java
Thu May  1 11:58:33 2008
@@ -144,7 +144,7 @@
             if(overrideUrl != null && overrideUrl.length() > 0) {
                 // Ignore other parameters if override URL (SLING-254) is set 
                 defaultConfig.put(RepositoryAccessor.REPOSITORY_URL_OVERRIDE_PROPERTY, overrideUrl);
-                log.debug(RepositoryAccessor.REPOSITORY_URL_OVERRIDE_PROPERTY + "=" + overrideUrl
+ 
+                log.info(RepositoryAccessor.REPOSITORY_URL_OVERRIDE_PROPERTY + "=" + overrideUrl
+ 
                     ", using it to create the default configuration");
                 
             } else {
@@ -155,7 +155,7 @@
             Configuration config = ca.createFactoryConfiguration(SERVER_REPOSITORY_FACTORY_PID);
             config.update(defaultConfig);
 
-            log.debug("verifyConfiguration: Created configuration {} for {}",
+            log.info("verifyConfiguration: Created configuration {} for {}",
                 config.getPid(), config.getFactoryPid());
 
         } catch (Throwable t) {
@@ -167,8 +167,16 @@
     }
     
     private void initDefaultConfig(Hashtable<String, String> props, BundleContext bundleContext)
throws IOException {
-        String slingHome = bundleContext.getProperty("sling.home");
-        log.debug("Creating default config, sling.home=" + slingHome);
+        File slingHome;
+        String slingHomePath = bundleContext.getProperty("sling.home");
+        if (slingHomePath != null) {
+            slingHome = new File(slingHomePath);
+        } else {
+            slingHome = new File("");
+        }
+        
+        // ensure slingHome is an absolute file and log its value
+        log.info("Creating default config, sling.home=" + slingHome);
 
         // make sure jackrabbit home exists
         File homeDir = new File(slingHome, this.getRepositoryName());
@@ -180,8 +188,8 @@
             }
         }
 
-        // ensure the configuration file
-        File configFile = new File(slingHome, "repository.xml");
+        // ensure the configuration file (inside the home Dir !)
+        File configFile = new File(homeDir, "repository.xml");
         SlingServerRepository.copyFile(bundleContext.getBundle(),
             "repository.xml", configFile);
 



Mime
View raw message