From 382b9cfecc5f1d44ae1ade68cae766ada69d9890 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 23 Oct 2014 15:07:11 +0000
Subject: [PATCH] Removed duplicate methods between org.opends.quicksetup.util.Utils and com.forgerock.opendj.cli.Utils. Code cleanup.

---
 opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java |   70 ----------------------------------
 1 files changed, 1 insertions(+), 69 deletions(-)

diff --git a/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java b/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java
index f7f23ae..8ee5cdc 100644
--- a/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java
+++ b/opendj3-server-dev/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -810,74 +810,6 @@
         env, trustManager, null, verifier);
   }
 
-
-/**
- * Tells whether the provided Throwable was caused because of a problem with
- * a certificate while trying to establish a connection.
- * @param t the Throwable to analyze.
- * @return <CODE>true</CODE> if the provided Throwable was caused because of a
- * problem with a certificate while trying to establish a connection and
- * <CODE>false</CODE> otherwise.
- */
-  public static boolean isCertificateException(Throwable t)
-  {
-    return com.forgerock.opendj.cli.Utils.isCertificateException(t);
-  }
-
-  /**
-   * Returns a message object for the given NamingException.
-   * @param ne the NamingException.
-   * @param hostPort the hostPort representation of the server we were
-   * contacting when the NamingException occurred.
-   * @return a message object for the given NamingException.
-   */
-  public static LocalizableMessage getMessageForException(NamingException ne,
-      String hostPort)
-  {
-    LocalizableMessage msg;
-    String arg;
-    if (ne.getLocalizedMessage() != null)
-    {
-      arg = ne.getLocalizedMessage();
-    }
-    else if (ne.getExplanation() != null)
-    {
-      arg = ne.getExplanation();
-    }
-    else
-    {
-      arg = ne.toString(true);
-    }
-    if (Utils.isCertificateException(ne))
-    {
-      msg = INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE_SERVER.get(
-          hostPort, arg);
-    }
-    else if (ne instanceof AuthenticationException)
-    {
-      msg = INFO_CANNOT_CONNECT_TO_REMOTE_AUTHENTICATION.get(hostPort, arg);
-    }
-    else if (ne instanceof NoPermissionException)
-    {
-      msg = INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS.get(hostPort, arg);
-    }
-    else if (ne instanceof NamingSecurityException)
-    {
-      msg = INFO_CANNOT_CONNECT_TO_REMOTE_PERMISSIONS.get(hostPort, arg);
-    }
-    else if (ne instanceof CommunicationException)
-    {
-      msg = ERR_CANNOT_CONNECT_TO_REMOTE_COMMUNICATION.get(hostPort, arg);
-    }
-    else
-    {
-       msg = INFO_CANNOT_CONNECT_TO_REMOTE_GENERIC.get(hostPort, arg);
-    }
-    return msg;
-  }
-
-
-
   /**
    * Returns a message object for the given NamingException.  The code assume
    * that we are trying to connect to the local server.
@@ -887,7 +819,7 @@
   public static LocalizableMessage getMessageForException(NamingException ne)
   {
     LocalizableMessage msg;
-    if (Utils.isCertificateException(ne))
+    if (isCertificateException(ne))
     {
       msg = INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE.get(ne.toString(true));
     }

--
Gitblit v1.10.0