From e0a4bed472576a2ac5b7a4bfdaae97668a5a45c0 Mon Sep 17 00:00:00 2001
From: ulrich <undisclosed>
Date: Fri, 06 Apr 2018 16:24:33 +0000
Subject: [PATCH] Kontext data nur erzeugen, wenn der Ordner www noch nicht existiert

---
 src/java/de/uhilger/filecms/web/Initialiser.java |   30 +++++++++++++-----------------
 1 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/src/java/de/uhilger/filecms/web/Initialiser.java b/src/java/de/uhilger/filecms/web/Initialiser.java
index 24926ce..9473f68 100644
--- a/src/java/de/uhilger/filecms/web/Initialiser.java
+++ b/src/java/de/uhilger/filecms/web/Initialiser.java
@@ -131,27 +131,23 @@
           FileUtils.copyDirectoryToDirectory(srcDir, dataDir);
           srcDir = new File(srcPath, "/META-INF/daten/dav");
           FileUtils.copyDirectoryToDirectory(srcDir, dataDir);          
+          // hier noch den context anlegen
+          String path = ctx.getRealPath("/");
+          //File appDir = new File(path);
+          logger.fine("Catalina Base: " + System.getProperty("catalina.base"));
+          //File catalinaBase = appDir.getParentFile().getParentFile();
+          File catalinaBase = new File(System.getProperty("catalina.base"));
+          File confLocalhost = new File(catalinaBase, "conf/Catalina/localhost");    
+          File dataContext = new File(confLocalhost, "data.xml");
+          srcDir = new File(path, "/META-INF/conf");
+          File dataCtxSrc = new File(srcDir, "data.xml");
+          logger.fine("dataCtxSrc: " + dataCtxSrc.getAbsolutePath());
+          logger.fine("dataContext: " + dataContext.getAbsolutePath());
+          FileUtils.copyFile(dataCtxSrc, dataContext);
         } catch (IOException ex) {
           logger.log(Level.SEVERE, null, ex);
         }
       }
-    }
-    // hier noch den context anlegen
-    String path = ctx.getRealPath("/");
-    //File appDir = new File(path);
-    logger.fine("Catalina Base: " + System.getProperty("catalina.base"));
-    //File catalinaBase = appDir.getParentFile().getParentFile();
-    File catalinaBase = new File(System.getProperty("catalina.base"));
-    File confLocalhost = new File(catalinaBase, "conf/Catalina/localhost");    
-    File dataContext = new File(confLocalhost, "data.xml");
-    File srcDir = new File(path, "/META-INF/conf");
-    File dataCtxSrc = new File(srcDir, "data.xml");
-    logger.fine("dataCtxSrc: " + dataCtxSrc.getAbsolutePath());
-    logger.fine("dataContext: " + dataContext.getAbsolutePath());
-    try {
-      FileUtils.copyFile(dataCtxSrc, dataContext);
-    } catch (IOException ex) {
-      logger.log(Level.SEVERE, null, ex);
     }
   }
 

--
Gitblit v1.9.3