Displaying differences for changeset
 
display as  

src/csip/Config.java

@@ -105,7 +105,7 @@
         /* 
          The CSIP version
          */
-        put("csip.version", "$version: 2.1.26 9f8d9f2ecc2c 2016-04-08 od, built at 2016-04-08 14:14 by od$");
+        put("csip.version", "$version: 2.1.28 fada42c746f2 2016-04-08 od, built at 2016-04-08 21:28 by od$");
 
         /*
          * The runtime architecture. 
@@ -185,7 +185,7 @@
            see duration string examples: https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-.
          */
         put("csip.archive.ttl", "P1D");  //  one day.
-        
+
         /* 
          If the archive is enabled, only archive failed runs, default: false
          */

src/csip/ServletContextHooks.java

@@ -18,6 +18,9 @@
  */
 package csip;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.logging.Logger;
@@ -48,7 +51,7 @@
         InputStream is = ctx.getResourceAsStream(file);
         if (is != null) {
             try {
-                l.info("Apply bundled context config '" + file + "'");
+                l.info("Applied bundled context config '" + file + "'");
                 ControlService.updateConfig(IOUtils.toString(is));
             } catch (IOException | JSONException ex) {
                 ex.printStackTrace(System.err);
@@ -62,6 +65,25 @@
         Config.startup(e.getServletContext());
         applyConfig(e.getServletContext(), "/WEB-INF/csip-defaults.json");
         applyConfig(e.getServletContext(), "/META-INF/csip-conf.json");
+
+        String s = e.getServletContext().getRealPath("/WEB-INF");
+        if (s != null) {
+            File file = new File(s).getParentFile();
+            if (file != null && file.exists()) {
+                File c = new File(file.getParentFile(), file.getName() + ".json");
+                if (c.exists()) {
+                    try {
+                        FileInputStream is = new FileInputStream(c);
+                        ControlService.updateConfig(IOUtils.toString(is));
+                        l.info("Applied config  '" + c + "'");
+                    } catch (FileNotFoundException ex) {
+                        // ignore
+                    } catch (JSONException | IOException ex) {
+                        ex.printStackTrace(System.err);
+                    }
+                }
+            }
+        }
         l.info("CSIP Context Created: " + e.getServletContext().getContextPath());
     }
 
@@ -71,5 +93,4 @@
         Config.shutdown(e.getServletContext());
         l.info("CSIP Context Destroyed: " + e.getServletContext().getContextPath());
     }
-
 }