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

kenneth_suter
15.34.2007 80c58327faaa4873369f6bb949e62792c2f708e0
opends/src/quicksetup/org/opends/quicksetup/webstart/WebStartDownloader.java
@@ -26,6 +26,7 @@
 */
package org.opends.quicksetup.webstart;
import org.opends.messages.Message;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -36,10 +37,11 @@
import javax.jnlp.ServiceManager;
import javax.jnlp.UnavailableServiceException;
import org.opends.quicksetup.i18n.ResourceProvider;
import org.opends.quicksetup.ApplicationException;
import org.opends.quicksetup.ApplicationReturnCode;
import org.opends.quicksetup.util.Utils;
import static org.opends.quicksetup.util.Utils.*;
import static org.opends.messages.QuickSetupMessages.*;
/**
 * This class is used to download the files that have been marked as lazy
@@ -82,7 +84,7 @@
  private Status status = Status.DOWNLOADING;
  private String summary = null;
  private Message summary = null;
  /**
   * This enumeration contains the different Status on which
@@ -109,7 +111,7 @@
   * Creates a default instance.
   */
  public WebStartDownloader() {
    this.summary = getMsg("downloading");
    this.summary = INFO_DOWNLOADING.get();
  }
  /**
@@ -136,8 +138,7 @@
          // This is a bug
          ex =
              new ApplicationException(ApplicationReturnCode.ReturnCode.BUG,
                      getExceptionMsg(
                  "bug-msg", mfe), mfe);
                      getThrowableMsg(INFO_BUG_MSG.get(),mfe), mfe);
        } catch (IOException ioe)
        {
          StringBuilder buf = new StringBuilder();
@@ -150,19 +151,17 @@
            }
            buf.append(jars[i]);
          }
          String[] arg =
            { buf.toString() };
          ex =
              new ApplicationException(
              ApplicationReturnCode.ReturnCode.DOWNLOAD_ERROR,
              getExceptionMsg("downloading-error", arg, ioe), ioe);
              getThrowableMsg(
                      INFO_DOWNLOADING_ERROR.get(buf.toString()), ioe), ioe);
        } catch (Throwable t)
        {
          // This is a bug
          ex =
              new ApplicationException(ApplicationReturnCode.ReturnCode.BUG,
                      getExceptionMsg(
                  "bug-msg", t), t);
                      getThrowableMsg(INFO_BUG_MSG.get(), t), t);
        }
      }
    });
@@ -173,7 +172,7 @@
   * Gets a summary message of the downloader's current progress.
   * @return String for showing the user progress
   */
  public String getSummary() {
  public Message getSummary() {
    return this.summary;
  }
@@ -181,7 +180,7 @@
   * Sets a summary message of the downloader's current progress.
   * @param summary String for showing the user progress
   */
  public void setSummary(String summary) {
  public void setSummary(Message summary) {
    this.summary = summary;
  }
@@ -366,8 +365,8 @@
  {
    ex =
        new ApplicationException(
        ApplicationReturnCode.ReturnCode.DOWNLOAD_ERROR, getMsg(
            "downloading-error", new String[] { url.toString() }), null);
        ApplicationReturnCode.ReturnCode.DOWNLOAD_ERROR,
                INFO_DOWNLOADING_ERROR.get(url.toString()), null);
  }
  /**
@@ -445,25 +444,4 @@
    return new String[getJarUrls().length];
  }
  /* Some commodity methods to get localized messages */
  private String getExceptionMsg(String key, Throwable t)
  {
    return getExceptionMsg(key, null, t);
  }
  private String getExceptionMsg(String key, String[] args, Throwable t)
  {
    return Utils.getThrowableMsg(ResourceProvider.getInstance(), key, args, t);
  }
  private String getMsg(String key, String[] args)
  {
    return ResourceProvider.getInstance().getMsg(key, args);
  }
  private String getMsg(String key)
  {
    return ResourceProvider.getInstance().getMsg(key);
  }
}