openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1830531 - /openwebbeans/meecrowave/trunk/meecrowave-core/src/main/java/org/apache/meecrowave/Meecrowave.java
Date Mon, 30 Apr 2018 06:53:35 GMT
Author: struberg
Date: Mon Apr 30 06:53:35 2018
New Revision: 1830531

URL: http://svn.apache.org/viewvc?rev=1830531&view=rev
Log:
MEECROWAVE-113 fix tempdir cleanup

Initially already fixed in MEECROWAVE-85 but got broken
due to a mis-applied PR again.

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=1830531&r1=1830530&r2=1830531&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
Mon Apr 30 06:53:35 2018
@@ -54,6 +54,7 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.Optional;
 import java.util.Properties;
 import java.util.ServiceLoader;
 import java.util.Set;
@@ -1033,10 +1034,16 @@ public class Meecrowave implements AutoC
             return dirFile.getAbsolutePath();
         }
 
-        final File file = new File(Stream.of(new File(System.getProperty("meecrowave.base",
"."), "temp").getAbsolutePath(), "target", "build", ".")
+        Optional<File> baseDir = Stream.of("target", "build")
                 .map(File::new)
                 .filter(File::isDirectory)
-                .findFirst().get(), "meecrowave-" + System.nanoTime());
+                .findFirst();
+        File file;
+        if (baseDir.isPresent()) {
+            file = new File(baseDir.get(), "meecrowave-" + System.nanoTime());
+        } else {
+            file = ownedTempDir;
+        }
         IO.mkdirs(file);
         return file.getAbsolutePath();
     }



Mime
View raw message