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

lutoff
23.38.2008 2cff58676a22376060f15a50e83dfc278850bfd3
Fix for issue #3491 (Upgrade from OpenDS 1.0 to revision 4498 fails)

When checking if instance and install are in the same dir, we now use the "installation" object.
Add also the creation of "instance.loc" when upgrading from 1.0.0
1 files modified
19 ■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -73,9 +73,11 @@
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileFilter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
@@ -1519,6 +1521,18 @@
        stage.move(root, new UpgradeFileFilter(getStageDirectory(),false));
      }
      // Check if instance.loc exits
      File instanceFile = new File
         (installation.getRootDirectory(), "instance.loc");
      if (! instanceFile.exists())
      {
        BufferedWriter instanceLoc =
          new BufferedWriter(new FileWriter(instanceFile));
        instanceLoc.append(
            installation.getInstanceDirectory().getAbsolutePath());
        instanceLoc.close();
      }
      // The bits should now be of the new version.  Have
      // the installation update the build information so
      // that it is correct.
@@ -1891,8 +1905,9 @@
  private boolean instanceAndInstallInSameDir()
  {
    File installDir  = new File(getInstallationPath()) ;
    File instanceDir = new File(getInstancePath()) ;
    Installation installation = getInstallation() ;
    File installDir  = installation.getRootDirectory();
    File instanceDir = installation.getInstanceDirectory();
    return installDir.getAbsolutePath().equals(instanceDir.getAbsolutePath());
  }