You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by re...@apache.org on 2018/05/16 10:19:03 UTC

svn commit: r1831697 - in /jackrabbit/branches/2.16: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java

Author: reschke
Date: Wed May 16 10:19:03 2018
New Revision: 1831697

URL: http://svn.apache.org/viewvc?rev=1831697&view=rev
Log:
JCR-4253: RepositoryConfig: add some handling for mkdir failure (ported to 2.16)

(patch by diego.schivo - thanks)

Modified:
    jackrabbit/branches/2.16/   (props changed)
    jackrabbit/branches/2.16/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java

Propchange: jackrabbit/branches/2.16/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 16 10:19:03 2018
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1816227,1817094,1817097-1817098,1817100,1817113,1817201,1817213,1817341,1817373,1817377,1818586,1819269,1819271,1819839,1819849,1820119,1820133,1820294,1820573,1820675,1821247,1821475,1821597,1821705,1821880,1822947,1822950,1824876,1826154,1826178,1826230,1826647,1826940,1826964
+/jackrabbit/trunk:1816227,1817094,1817097-1817098,1817100,1817113,1817201,1817213,1817341,1817373,1817377,1818586,1819269,1819271,1819839,1819849,1820119,1820133,1820294,1820573,1820675,1821247,1821475,1821597,1821705,1821880,1822863,1822947,1822950,1824876,1826154,1826178,1826230,1826647,1826940,1826964

Modified: jackrabbit/branches/2.16/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.16/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java?rev=1831697&r1=1831696&r2=1831697&view=diff
==============================================================================
--- jackrabbit/branches/2.16/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java (original)
+++ jackrabbit/branches/2.16/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java Wed May 16 10:19:03 2018
@@ -192,10 +192,13 @@ public class RepositoryConfig
 
     private static void installRepositorySkeleton(
             File dir, File xml, URL resource)
-            throws IOException {
+            throws IOException, ConfigurationException {
         if (!dir.exists()) {
             log.info("Creating repository directory {}", dir);
-            dir.mkdirs();
+            boolean dirCreated = dir.mkdirs();
+            if (!dirCreated) {
+                throw new ConfigurationException("Cannot create repository directory " + dir);
+            }
         }
 
         if (!xml.exists()) {
@@ -541,7 +544,10 @@ public class RepositoryConfig
         // Get the physical workspace root directory (create it if not found)
         File directory = new File(workspaceDirectory);
         if (!directory.exists()) {
-            directory.mkdirs();
+            boolean directoryCreated = directory.mkdirs();
+            if (!directoryCreated) {
+                throw new ConfigurationException("Cannot create workspace root directory " + directory);
+            }
         }
 
         // Get all workspace subdirectories