openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1780156 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Date Wed, 25 Jan 2017 09:33:14 GMT
Author: rmannibucau
Date: Wed Jan 25 09:33:14 2017
New Revision: 1780156

URL: http://svn.apache.org/viewvc?rev=1780156&view=rev
Log:
cleaning webapp dir cleanup

Modified:
    openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java

Modified: openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
URL: http://svn.apache.org/viewvc/openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java?rev=1780156&r1=1780155&r2=1780156&view=diff
==============================================================================
--- openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
(original)
+++ openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Wed Jan 25 09:33:14 2017
@@ -199,19 +199,17 @@ public class Meecrowave implements AutoC
         new LogFacade(Meecrowave.class.getName()).info("--------------- " + base + meta.context);
 
 
-        final File dir = ofNullable(meta.docBase).orElse(null);
-
         final OWBJarScanner scanner = new OWBJarScanner();
         final StandardContext ctx = new StandardContext();
         ctx.setPath(meta.context);
         ctx.setName(meta.context);
         ctx.setJarScanner(scanner);
         ctx.setInstanceManager(new CDIInstanceManager());
-        ofNullable(dir).ifPresent(d -> {
+        ofNullable(meta.docBase).ifPresent(d -> {
             try {
-                ctx.setDocBase(d.getCanonicalPath());
+                ctx.setDocBase(meta.docBase.getCanonicalPath());
             } catch (final IOException e) {
-                ctx.setDocBase(d.getAbsolutePath());
+                ctx.setDocBase(meta.docBase.getAbsolutePath());
             }
         });
         ofNullable(configuration.tomcatFilter).ifPresent(filter -> {
@@ -221,7 +219,7 @@ public class Meecrowave implements AutoC
                 throw new IllegalArgumentException(e);
             }
         });
-        ctx.addLifecycleListener(new MeecrowaveContextConfig(configuration, dir != null));
+        ctx.addLifecycleListener(new MeecrowaveContextConfig(configuration, meta.docBase
!= null));
         ctx.addLifecycleListener(event -> {
             switch (event.getType()) {
                 case Lifecycle.AFTER_START_EVENT:
@@ -311,14 +309,7 @@ public class Meecrowave implements AutoC
         tomcat.getHost().addChild(ctx);
         contexts.put(meta.context, () -> {
             ofNullable(releaseSCI.get()).ifPresent(Runnable::run);
-            try {
-                tomcat.getHost().removeChild(ctx);
-            } finally {
-                if (dir != null && dir != meta.docBase) {
-                    IO.delete(dir);
-                }
-            }
-
+            tomcat.getHost().removeChild(ctx);
         });
         return this;
     }



Mime
View raw message