mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
17.53.2007 8feee36de8e6042f928439b06a03d50018423afe
opends/src/quicksetup/org/opends/quicksetup/util/Utils.java
@@ -48,6 +48,7 @@
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.TrustManager;
import org.opends.admin.ads.TopologyCacheException;
import org.opends.admin.ads.util.ConnectionUtils;
import org.opends.quicksetup.*;
import org.opends.quicksetup.webstart.JnlpProperties;
@@ -665,6 +666,35 @@
  }
  /**
   * Gets a localized representation of the provide TopologyCacheException.
   * @param te the exception.
   * @return a localized representation of the provide TopologyCacheException.
   */
  public static String getStringRepresentation(TopologyCacheException te)
  {
    MessageBuilder buf = new MessageBuilder();
    String ldapUrl = te.getLdapUrl();
    if (ldapUrl != null)
    {
      String hostName = ldapUrl.substring(ldapUrl.indexOf("://") + 3);
      buf.append(INFO_SERVER_ERROR.get(hostName));
      buf.append(" ");
    }
    if (te.getCause() instanceof NamingException)
    {
      buf.append(getThrowableMsg(INFO_ERROR_CONNECTING_TO_LOCAL.get(),
          te.getCause()));
    }
    else
    {
      // This is unexpected.
      buf.append(getThrowableMsg(INFO_BUG_MSG.get(), te.getCause()));
    }
    return buf.toString();
  }
  /**
   * Sets the permissions of the provided paths with the provided permission
   * String.
   * @param paths the paths to set permissions on.