From 9da0e4e944ec51ed4e65961c2389bfe1aa314cae Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Wed, 29 May 2013 12:46:19 +0000
Subject: [PATCH] OPENDJ-928 Update tool: add option to automatically accept the license - License is now accepted at the end of upgrade's process (if no errors).

---
 opends/src/server/org/opends/server/tools/upgrade/Upgrade.java |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java b/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java
index f4a5d5e..128eafd 100644
--- a/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java
+++ b/opends/src/server/org/opends/server/tools/upgrade/Upgrade.java
@@ -411,6 +411,9 @@
         // At the end, and if only if succeed, we need to change the buildInfo
         // file with the version number updated.
         changeBuildInfoVersion(context, handler);
+
+        // Writes the license if needed.
+        LicenseFile.createFileLicenseApproved();
       }
       else
       {
@@ -661,26 +664,19 @@
           }
           else if (answer == ConfirmationCallback.YES)
           {
-            createLicenseApproval();
+            LicenseFile.setApproval(true);
           }
         }
         else
         {
           context.notify(handler, INFO_LICENSE_ACCEPT.get());
           context.notify(handler, INFO_PROMPT_YES_COMPLETE_ANSWER.get());
-          createLicenseApproval();
+          LicenseFile.setApproval(true);
         }
       }
     }
   }
 
-  private static void createLicenseApproval()
-  {
-    // Creates the file
-    LicenseFile.setApproval(true);
-    LicenseFile.createFileLicenseApproved();
-  }
-
   // Prevent instantiation.
   private Upgrade()
   {

--
Gitblit v1.10.0