jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r630285 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java
Date Fri, 22 Feb 2008 18:51:45 GMT
Author: jukka
Date: Fri Feb 22 10:51:41 2008
New Revision: 630285

URL: http://svn.apache.org/viewvc?rev=630285&view=rev
Log:
JCR-1394: FileDataStore Garbage Collector and empty directories
    - Automatic removal of empty directories
    - Based on suggestion by Jacco van Weert

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java?rev=630285&r1=630284&r2=630285&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/FileDataStore.java
Fri Feb 22 10:51:41 2008
@@ -281,6 +281,11 @@
             for (int i = 0; i < list.length; i++) {
                 count += deleteOlderRecursive(list[i], min);
             }
+            // JCR-1396: FileDataStore Garbage Collector and empty directories
+            // Automatic removal of empty directories (but not the root!)
+            if (file != directory && file.list().length == 0) {
+                file.delete();
+            }
         }
         return count;
     }



Mime
View raw message