Make empty start up more robust
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 11 Aug 2022 06:49:50 +0000 (08:49 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 11 Aug 2022 06:49:50 +0000 (08:49 +0200)
org.argeo.cms/src/org/argeo/cms/internal/runtime/CmsStateImpl.java
org.argeo.cms/src/org/argeo/cms/internal/runtime/KernelUtils.java

index b76ca5792deeb20ade7a6f4167b7909de2ee3590..cb806444fc668c3e5508263de895e376b741f924 100644 (file)
@@ -149,9 +149,10 @@ public class CmsStateImpl implements CmsState {
                                log.debug("## CMS starting... (" + uuid + ")\n" + sb + "\n");
                        }
 
-                       Path nodeBase = getDataPath(KernelConstants.DIR_PRIVATE);
-                       if (nodeBase != null && !Files.exists(nodeBase)) {// first init
+                       Path privateBase = getDataPath(KernelConstants.DIR_PRIVATE);
+                       if (privateBase != null && !Files.exists(privateBase)) {// first init
                                firstInit();
+                               Files.createDirectories(privateBase);
                        }
 
                } catch (RuntimeException | IOException e) {
index 295578f535a3711fdf90bcab95fab58433c6042f..7165966486824fa56d842ded78c824bee0d7dc82 100644 (file)
@@ -55,11 +55,11 @@ class KernelUtils implements KernelConstants {
                Path executionDir = Paths.get(getFrameworkProp("user.dir"));
                if (relativePath == null)
                        return executionDir;
-               try {
-                       return executionDir.resolve(relativePath).toRealPath();
-               } catch (IOException e) {
-                       throw new IllegalArgumentException("Cannot get canonical file", e);
-               }
+//             try {
+               return executionDir.resolve(relativePath);
+//             } catch (IOException e) {
+//                     throw new IllegalArgumentException("Cannot get canonical file", e);
+//             }
        }
 
 //     static File getOsgiInstanceDir() {