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/util/FileManager.java | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java b/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
index f8e572e..f3a9181 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/util/FileManager.java
@@ -112,6 +112,32 @@
}
/**
+ * Recursively copies any files or directories appearing in
+ * <code>source</code> or a subdirectory of <code>source</code>
+ * to the corresponding directory under <code>target</code>. Files
+ * in under <code>source</code> are not copied to <code>target</code>
+ * if a file by the same name already exists in <code>target</code>.
+ *
+ * @param source source directory
+ * @param target target directory
+ * @param filter for specifying particular files to synchronize
+ * @throws ApplicationException if there is a problem copying files
+ */
+ public void synchronize(File source, File target, FileFilter filter)
+ throws ApplicationException
+ {
+ if (source != null && target != null) {
+ String[] sourceFileNames = source.list();
+ if (sourceFileNames != null) {
+ for (String sourceFileName : sourceFileNames) {
+ File sourceFile = new File(source, sourceFileName);
+ copyRecursively(sourceFile, target, filter, false);
+ }
+ }
+ }
+ }
+
+ /**
* Renames the source file to the target file. If the target file exists
* it is first deleted. The rename and delete operation return values
* are checked for success and if unsuccessful, this method throws an
--
Gitblit v1.10.0