manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1181294 - /incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Date Mon, 10 Oct 2011 23:12:24 GMT
Author: kwright
Date: Mon Oct 10 23:12:24 2011
New Revision: 1181294

URL: http://svn.apache.org/viewvc?rev=1181294&view=rev
Log:
Apparently HSQLDB shutdown deletes some of the files, so we need to check for existence. 
Part of CONNECTORS-269.

Modified:
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1181294&r1=1181293&r2=1181294&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Mon Oct 10 23:12:24 2011
@@ -547,26 +547,29 @@ public class DBInterfaceHSQLDB extends D
   
   protected static void recursiveDelete(File f)
   {
-    File[] files = f.listFiles();
-    if (files != null)
+    if (f.exists())
     {
-      int i = 0;
-      while (i < files.length)
+      File[] files = f.listFiles();
+      if (files != null)
       {
-        File newf = files[i++];
-        if (newf.isDirectory())
-          recursiveDelete(newf);
-        else
-          singleDelete(newf);
+        int i = 0;
+        while (i < files.length)
+        {
+          File newf = files[i++];
+          if (newf.isDirectory())
+            recursiveDelete(newf);
+          else
+            singleDelete(newf);
+        }
       }
+      if (!f.delete())
+        System.out.println("Failed to delete directory "+f.toString());
     }
-    if (!f.delete())
-      System.out.println("Failed to delete directory "+f.toString());
   }
 
   protected static void singleDelete(File f)
   {
-    if (!f.delete())
+    if (f.exists() && !f.delete())
       System.out.println("Failed to delete file "+f.toString());
   }
   



Mime
View raw message