From 81ebf9aa63b819ecdc6b3b1b3d7d9a551dc23d76 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 11 Jul 2007 21:14:32 +0000
Subject: [PATCH] This commit addresses issue 1973 "exclude some config subdirectories from copy during upgrade". During an upgrade, the contents of the old config directory are recursively copied to the new config directory in order to retain things like the keystore and other SSL related artifacts and tasks.ldif. There are however some files that should not be copied over, namely the contents of the upgrade and schema subdirectories. This commit excludes those subdirectories.
---
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index a15654c..2aa9b35 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -1378,7 +1378,19 @@
File newConfigDir =
getInstallation().getConfigurationDirectory();
FileManager fm = new FileManager();
- fm.synchronize(oldConfigDir, newConfigDir);
+
+ // Define a filter for files that we don't want to copy over
+ // from the old config directory.
+ final File oldConfigUpgradeDir = new File(oldConfigDir, "upgrade");
+ final File oldConfigSchemaDir = new File(oldConfigDir, "schema");
+ FileFilter filter = new FileFilter() {
+ public boolean accept(File f) {
+ return !Utils.isDescendant(f, oldConfigUpgradeDir) &&
+ !Utils.isDescendant(f, oldConfigSchemaDir);
+ }
+ };
+
+ fm.synchronize(oldConfigDir, newConfigDir, filter);
}
private boolean calculateConfigCustomizations() throws ApplicationException {
--
Gitblit v1.10.0