incubator-ftpserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r498134 - in /incubator/ftpserver/trunk/core/src: java/org/apache/ftpserver/util/IoUtils.java java/org/apache/ftpserver/util/OS.java test/org/apache/ftpserver/test/OS.java
Date Sat, 20 Jan 2007 16:04:40 GMT
Author: ngn
Date: Sat Jan 20 08:04:39 2007
New Revision: 498134

URL: http://svn.apache.org/viewvc?view=rev&rev=498134
Log:
Adding known hack for deleting files on Windows.

Added:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/OS.java
      - copied, changed from r487956, incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/test/OS.java
Removed:
    incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/test/OS.java
Modified:
    incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/IoUtils.java

Modified: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/IoUtils.java
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/IoUtils.java?view=diff&rev=498134&r1=498133&r2=498134
==============================================================================
--- incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/IoUtils.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/IoUtils.java Sat Jan
20 08:04:39 2007
@@ -247,7 +247,16 @@
 
     private final static void deleteFile(File file) throws IOException {
         if(!file.delete()) {
-            throw new IOException("Failed to delete file: " + file);
+            if(OS.isFamilyWindows()) {
+                System.gc();
+            }
+            try {
+                Thread.sleep(10);
+            } catch (InterruptedException e) {
+            }
+            if(!file.delete()) {
+                throw new IOException("Failed to delete file: " + file);
+            }
         }
     }
 }    

Copied: incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/OS.java (from r487956,
incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/test/OS.java)
URL: http://svn.apache.org/viewvc/incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/OS.java?view=diff&rev=498134&p1=incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/test/OS.java&r1=487956&p2=incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/OS.java&r2=498134
==============================================================================
--- incubator/ftpserver/trunk/core/src/test/org/apache/ftpserver/test/OS.java (original)
+++ incubator/ftpserver/trunk/core/src/java/org/apache/ftpserver/util/OS.java Sat Jan 20 08:04:39
2007
@@ -15,7 +15,7 @@
  *
  */
 
-package org.apache.ftpserver.test;
+package org.apache.ftpserver.util;
 
 import java.util.Locale;
 



Mime
View raw message