[KARAF-3826] Create the directory and cave repository properties file if needed
diff --git a/server/storage/src/main/java/org/apache/karaf/cave/server/storage/Activator.java b/server/storage/src/main/java/org/apache/karaf/cave/server/storage/Activator.java
index c24e1f8..379dc8f 100644
--- a/server/storage/src/main/java/org/apache/karaf/cave/server/storage/Activator.java
+++ b/server/storage/src/main/java/org/apache/karaf/cave/server/storage/Activator.java
@@ -17,32 +17,15 @@
 package org.apache.karaf.cave.server.storage;
 
 import java.io.File;
-import java.util.Hashtable;
 
 import org.apache.karaf.cave.server.api.CaveRepositoryService;
 import org.apache.karaf.util.tracker.BaseActivator;
 import org.apache.karaf.util.tracker.annotation.Managed;
 import org.apache.karaf.util.tracker.annotation.ProvideService;
-import org.apache.karaf.util.tracker.annotation.RequireService;
 import org.apache.karaf.util.tracker.annotation.Services;
 import org.osgi.framework.FrameworkUtil;
-import org.osgi.framework.ServiceRegistration;
 import org.osgi.service.cm.ManagedService;
 
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 @Services(
         provides = { @ProvideService(CaveRepositoryService.class) }
 )
diff --git a/server/storage/src/main/java/org/apache/karaf/cave/server/storage/CaveRepositoryServiceImpl.java b/server/storage/src/main/java/org/apache/karaf/cave/server/storage/CaveRepositoryServiceImpl.java
index 9c0981b..60dba4b 100644
--- a/server/storage/src/main/java/org/apache/karaf/cave/server/storage/CaveRepositoryServiceImpl.java
+++ b/server/storage/src/main/java/org/apache/karaf/cave/server/storage/CaveRepositoryServiceImpl.java
@@ -213,6 +213,10 @@
     private void saveStorage(Properties properties, File location, String comment) throws IOException {
         OutputStream os = null;
         try {
+            if (!location.exists()) {
+                location.getParentFile().mkdirs();
+                location.createNewFile();
+            }
             os = new FileOutputStream(location);
             properties.store(os, comment);
         } finally {