From 4f87eb03990d981d8abb3fc60e04f4b459ebe3dc Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 24 May 2007 19:24:49 +0000
Subject: [PATCH] issue 1628: fix for upgrader leaving files in the tmp directory
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index 1ef0942..c9e96c5 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -1426,12 +1426,13 @@
stagingDir = getStageDirectory();
FileManager fm = new FileManager();
- // Doing this seems to work better than just plain
- // old delete. Note that on Windows there are file
- // locking issues to we mark files for deletion after
- // this JVM exits
+ // On Linux at least the deleteOnExit seems not to work very well
+ // for directories that contain files, even if they have been marked
+ // for deletion upon exit as well. Note that on Windows there are
+ // file locking issues so we mark files for deletion after this JVM exits.
if (stagingDir.exists()) {
- fm.deleteRecursively(stagingDir, null, /*onExit=*/true);
+ fm.deleteRecursively(stagingDir, null,
+ FileManager.DeletionPolicy.DELETE_ON_EXIT_IF_UNSUCCESSFUL);
}
} catch (IOException e) {
--
Gitblit v1.10.0