cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r934268 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java rt/core/src/test/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptorTest.java
Date Thu, 15 Apr 2010 03:03:35 GMT
Author: dkulp
Date: Thu Apr 15 03:03:35 2010
New Revision: 934268

URL: http://svn.apache.org/viewvc?rev=934268&view=rev
Log:
Don't call deleteOnExit during shutdown

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
    cxf/trunk/rt/core/src/test/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptorTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java?rev=934268&r1=934267&r2=934268&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java Thu Apr 15
03:03:35 2010
@@ -79,7 +79,7 @@ public final class FileUtils {
             Thread hook = new Thread() {
                 @Override
                 public void run() {
-                    removeDir(defaultTempDir);
+                    removeDir(defaultTempDir, true);
                 }
             };
             Runtime.getRuntime().addShutdownHook(hook);            
@@ -125,6 +125,9 @@ public final class FileUtils {
     }
 
     public static void removeDir(File d) {
+        removeDir(d, false);
+    }
+    private static void removeDir(File d, boolean inShutdown) {
         String[] list = d.list();
         if (list == null) {
             list = new String[0];
@@ -133,15 +136,18 @@ public final class FileUtils {
             String s = list[i];
             File f = new File(d, s);
             if (f.isDirectory()) {
-                removeDir(f);
+                removeDir(f, inShutdown);
             } else {
-                delete(f);
+                delete(f, inShutdown);
             }
         }
-        delete(d);
+        delete(d, inShutdown);
     }
 
     public static void delete(File f) {
+        delete(f, false);
+    }
+    public static void delete(File f, boolean inShutdown) {
         if (!f.delete()) {
             if (isWindows()) {
                 System.gc();
@@ -151,7 +157,7 @@ public final class FileUtils {
             } catch (InterruptedException ex) {
                 // Ignore Exception
             }
-            if (!f.delete()) {
+            if (!f.delete() && !inShutdown) {
                 f.deleteOnExit();
             }
         }

Modified: cxf/trunk/rt/core/src/test/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/test/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptorTest.java?rev=934268&r1=934267&r2=934268&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/test/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptorTest.java
(original)
+++ cxf/trunk/rt/core/src/test/java/org/apache/cxf/interceptor/security/SimpleAuthorizingInterceptorTest.java
Thu Apr 15 03:03:35 2010
@@ -139,6 +139,7 @@ public class SimpleAuthorizingIntercepto
     }
     
     private static class TestService {
+        @SuppressWarnings("unused")
         public void echo() {
             
         }



Mime
View raw message