From 80c58327faaa4873369f6bb949e62792c2f708e0 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.

---
 opends/src/quicksetup/org/opends/quicksetup/Installation.java |   28 +++++++++++-----------------
 1 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/Installation.java b/opends/src/quicksetup/org/opends/quicksetup/Installation.java
index 4856787..5147d22 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/Installation.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/Installation.java
@@ -27,6 +27,9 @@
 
 package org.opends.quicksetup;
 
+import org.opends.messages.Message;
+import static org.opends.messages.QuickSetupMessages.*;
+
 import java.io.*;
 import java.util.*;
 import java.util.logging.Level;
@@ -36,7 +39,6 @@
 import java.util.concurrent.ExecutionException;
 
 import org.opends.quicksetup.util.Utils;
-import org.opends.quicksetup.i18n.ResourceProvider;
 
 /**
  * This class represents the physical state of an OpenDS installation.
@@ -251,14 +253,14 @@
    */
   static public void validateRootDirectory(File rootDirectory)
           throws IllegalArgumentException {
-    String failureReason = null;
+    Message failureReason = null;
     if (rootDirectory == null) {
-      failureReason = getMsg("error-install-root-dir-null");
+      failureReason = INFO_ERROR_INSTALL_ROOT_DIR_NULL.get();
     } else if (!rootDirectory.exists()) {
-      failureReason = getMsg("error-install-root-dir-no-exist",
+      failureReason = INFO_ERROR_INSTALL_ROOT_DIR_NO_EXIST.get(
               Utils.getPath(rootDirectory));
     } else if (!rootDirectory.isDirectory()) {
-      failureReason = getMsg("error-install-root-dir-not-dir",
+      failureReason = INFO_ERROR_INSTALL_ROOT_DIR_NOT_DIR.get(
               Utils.getPath(rootDirectory));
     } else {
       String[] children = rootDirectory.list();
@@ -266,17 +268,17 @@
         Set<String> childrenSet = new HashSet<String>(Arrays.asList(children));
         for (String dir : REQUIRED_DIRECTORIES) {
           if (!childrenSet.contains(dir)) {
-            failureReason = getMsg("error-install-root-dir-no-dir",
+            failureReason = INFO_ERROR_INSTALL_ROOT_DIR_NO_DIR.get(
                     Utils.getPath(rootDirectory), dir);
           }
         }
       } else {
-        failureReason = getMsg("error-install-root-dir-empty",
-                    Utils.getPath(rootDirectory));
+        failureReason = INFO_ERROR_INSTALL_ROOT_DIR_EMPTY.get(
+                Utils.getPath(rootDirectory));
       }
     }
     if (failureReason != null) {
-      throw new IllegalArgumentException(failureReason);
+      throw new IllegalArgumentException(failureReason.toString());
     }
   }
 
@@ -791,12 +793,4 @@
     return Utils.getPath(rootDirectory);
   }
 
-  static private String getMsg(String key) {
-    return ResourceProvider.getInstance().getMsg(key);
-  }
-
-  static private String getMsg(String key, String... args) {
-    return ResourceProvider.getInstance().getMsg(key, args);
-  }
-
 }
\ No newline at end of file

--
Gitblit v1.10.0