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

jvergara
20.09.2007 cb4fffb7bf1f9de28183fe58376f5762b1e45cf9
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
@@ -28,6 +28,7 @@
package org.opends.quicksetup.installer.webstart;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.ArrayList;
@@ -111,6 +112,7 @@
      notifyListeners(getTaskSeparator());
      status = InstallProgressStep.EXTRACTING;
      createParentDirectoryIfRequired();
      extractZipFiles(in, getRatio(InstallProgressStep.EXTRACTING),
          getRatio(InstallProgressStep.CONFIGURING_SERVER));
      notifyListeners(getTaskSeparator());
@@ -360,6 +362,37 @@
  }
  /**
   * Creates the parent Directory for the server location if it does not exist.
   * @throws QuickSetupException if something goes wrong.
   */
  private void createParentDirectoryIfRequired() throws QuickSetupException
  {
    String serverLocation = getUserData().getServerLocation();
    if (!Utils.parentDirectoryExists(serverLocation))
    {
      File f = new File(serverLocation);
      String parent = f.getParent();
      try
      {
        if (!Utils.createDirectory(parent))
        {
          throw new QuickSetupException(
              QuickSetupException.Type.FILE_SYSTEM_ERROR,
              getMsg("error-could-not-create-parent-dir",
                  new String[] {parent}), null);
        }
      }
      catch (IOException ioe)
      {
        throw new QuickSetupException(
            QuickSetupException.Type.FILE_SYSTEM_ERROR,
            getMsg("error-could-not-create-parent-dir", new String[] {parent}),
            ioe);
      }
    }
  }
  /**
   * This method extracts the zip file.
   * @param is the inputstream with the contents of the zip file.
   * @param minRatio the value of the ratio in the install that corresponds to