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

Valery Kharseko
9 hours ago 83db1555233d219fe0d8642a16ef64fc127ada54
opendj-server-legacy/src/main/java/org/opends/server/admin/doc/ConfigGuideGeneration.java
@@ -19,6 +19,7 @@
import java.io.File;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
@@ -98,7 +99,7 @@
   *
   * Properties:
   * GenerationDir - The directory where the doc is generated
   *              (default is /var/tmp/[CONFIG_GUIDE_DIR>])
   *              (default is a fresh temporary directory, printed on startup)
   * LdapMapping - Presence means that the LDAP mapping section is to be
   *               generated (default is no)
   * OpenDJWiki - The URL of the OpenDJ Wiki
@@ -112,14 +113,14 @@
  public static void main(String[] args) {
    Properties properties = System.getProperties();
    generationDir = properties.getProperty("GenerationDir");
    if (generationDir == null) {
      // Default dir is prefixed by the system-dependent default temporary dir
      generationDir = System.getProperty("java.io.tmpdir") + File.separator +
        CONFIG_GUIDE_DIR;
    }
    // Create new dir if necessary
    try {
      new File(generationDir).mkdir();
      if (generationDir == null) {
        // Default dir is a fresh temporary dir, only accessible by the current user
        generationDir = Files.createTempDirectory(CONFIG_GUIDE_DIR).toString();
      } else {
        // Create new dir if necessary
        new File(generationDir).mkdir();
      }
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);