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/06/18 06:57:57 UTC

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

Author: reschke
Date: Mon Jun 18 06:57:57 2018
New Revision: 1833682

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

(patch by diego.schivo - thanks)

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

Propchange: jackrabbit/branches/2.14/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 18 06:57:57 2018
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1776907,1776911-1776912,1776914,1776918,1779166,1779460,1779614,1779632,1780208,1780220,1780406,1785225,1786325,1786330,1787043,1787381,1792100,1792105,1792113,1792193,1793315,1793323,1793327,1793332,1793339,1796980,1797209,1797917,1798586,1799429,1799538,1799549,1799575,1800359,1800378,1800752,1802925,1802977,1807234,1807244,1808752,1808754,1809149,1809329,1809624,1810108,1811667,1812543,1812634,1812994,1814831,1817094,1817097-1817098,1817100,1817113,1817201,1817213,1817373,1817377,1818586,1819269,1819271,1819839,1819849,1820119,1820133,1820294,1820573,1820675,1821247,1821475,1821597,1821705,1821880,1822947,1822950,1824876,1826230,1826647,1826940,1826964,1833374
+/jackrabbit/trunk:1776907,1776911-1776912,1776914,1776918,1779166,1779460,1779614,1779632,1780208,1780220,1780406,1785225,1786325,1786330,1787043,1787381,1792100,1792105,1792113,1792193,1793315,1793323,1793327,1793332,1793339,1796980,1797209,1797917,1798586,1799429,1799538,1799549,1799575,1800359,1800378,1800752,1802925,1802977,1807234,1807244,1808752,1808754,1809149,1809329,1809624,1810108,1811667,1812543,1812634,1812994,1814831,1817094,1817097-1817098,1817100,1817113,1817201,1817213,1817373,1817377,1818586,1819269,1819271,1819839,1819849,1820119,1820133,1820294,1820573,1820675,1821247,1821475,1821597,1821705,1821880,1822863,1822947,1822950,1824876,1826230,1826647,1826940,1826964,1833374

Modified: jackrabbit/branches/2.14/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.14/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java?rev=1833682&r1=1833681&r2=1833682&view=diff
==============================================================================
--- jackrabbit/branches/2.14/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java (original)
+++ jackrabbit/branches/2.14/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfig.java Mon Jun 18 06:57:57 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