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

Jean-Noel Rouvignac
26.47.2015 6637153a58af50420660a656d04ef48eedda2a9c
opendj3-server-dev/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
@@ -297,9 +297,7 @@
    // Determine the number of indexes.
    this.indexCount = getTotalIndexCount(localDBBackendCfg);
    this.clearedBackend =
        !importConfiguration.appendToExistingData()
            && (importConfiguration.clearBackend() || localDBBackendCfg.getBaseDN().size() <= 1);
    this.clearedBackend = mustClearBackend(importConfiguration, localDBBackendCfg);
    this.scratchFileWriterList =
        new ArrayList<ScratchFileWriterTask>(indexCount);
    this.scratchFileWriterFutures = new CopyOnWriteArrayList<Future<Void>>();
@@ -326,6 +324,19 @@
    }
  }
  /**
   * Returns whether the backend must be cleared.
   *
   * @param importCfg the import configuration object
   * @param backendCfg the backend configuration object
   * @return true if the backend must be cleared, false otherwise
   */
  public static boolean mustClearBackend(LDIFImportConfig importCfg, LocalDBBackendCfg backendCfg)
  {
    return !importCfg.appendToExistingData()
        && (importCfg.clearBackend() || backendCfg.getBaseDN().size() <= 1);
  }
  private File getTempDir(LocalDBBackendCfg localDBBackendCfg, String tmpDirectory)
  {
    File parentDir;