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

Valery Kharseko
6 hours ago 069a1256c6ebdc1142e525a44733bc32fd834061
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigurationHandler.java
@@ -817,25 +817,14 @@
    }
    // If a ".startok" file already exists, then move it to an ".old" file.
    // renameFile() deletes an existing ".old" file and reports a failure to do so.
    File oldFile = new File(oldFilePath);
    try
    {
      if (oldFile.exists())
      {
        oldFile.delete();
      }
    }
    catch (Exception e)
    {
      logger.traceException(e);
    }
    File startOKFile = new File(startOKFilePath);
    try
    {
      if (startOKFile.exists())
      {
        startOKFile.renameTo(oldFile);
        renameFile(startOKFile, oldFile);
      }
    }
    catch (Exception e)
@@ -846,7 +835,7 @@
    // Rename the temp file to the ".startok" file.
    try
    {
      tempFile.renameTo(startOKFile);
      renameFile(tempFile, startOKFile);
    }
    catch (Exception e)
    {
@@ -1609,20 +1598,12 @@
    // Move the current config file out of the way and replace it with the updated version.
    File oldSource = new File(sourceFile.getAbsolutePath() + ".prechanges");
    if (oldSource.exists())
    {
      oldSource.delete();
    }
    sourceFile.renameTo(oldSource);
    new File(tempFilePath).renameTo(sourceFile);
    renameFile(sourceFile, oldSource);
    renameFile(new File(tempFilePath), sourceFile);
    // Move the changes file out of the way so it doesn't get applied again.
    File newChanges = new File(changesFile.getAbsolutePath() + ".applied");
    if (newChanges.exists())
    {
      newChanges.delete();
    }
    changesFile.renameTo(newChanges);
    renameFile(changesFile, newChanges);
  }
  private void applyConfigChangesIfNeeded(File configFileToUse) throws InitializationException