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

Jean-Noël Rouvignac
26.30.2016 310df200f78f7d98cc52e4ab97d8a5feb744fa52
opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
@@ -73,14 +73,10 @@
 * server process (e.g., via the tasks interface).
 */
public class ImportLDIF extends TaskTool {
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /**
   * The buffer size that should be used when reading data from LDIF.
   */
  public static final int LDIF_BUFFER_SIZE = 1048576;
  /** The buffer size that should be used when reading data from LDIF. */
  private static final int LDIF_BUFFER_SIZE = 1048576;
  /**
   * The main method for ImportLDIF tool.
@@ -90,7 +86,6 @@
  public static void main(String[] args)
  {
    int retCode = mainImportLDIF(args, true, System.out, System.err);
    if(retCode != 0)
    {
      System.exit(filterExitCode(retCode));
@@ -100,17 +95,6 @@
  /**
   * Processes the command-line arguments and invokes the import process.
   *
   * @param  args  The command-line arguments provided to this program.
   * @return The error code.
   */
  public static int mainImportLDIF(String[] args)
  {
    return mainImportLDIF(args, true, System.out, System.err);
  }
  /**
   * Processes the command-line arguments and invokes the import process.
   *
   * @param  args              The command-line arguments provided to this
   *                           program.
   * @param  initializeServer  Indicates whether to initialize the server.
@@ -157,14 +141,12 @@
  private int process(String[] args, boolean initializeServer,
                      OutputStream outStream, OutputStream errStream) {
    PrintStream out = NullOutputStream.wrapOrNullStream(outStream);
    PrintStream err = NullOutputStream.wrapOrNullStream(errStream);
    JDKLogging.disableLogging();
    // FIXME -- Need to add a mechanism for verifying the file signature.
    // Create the command-line argument parser for use with this program.
    LDAPConnectionArgumentParser argParser =
            createArgParser("org.opends.server.tools.ImportLDIF", INFO_LDIFIMPORT_TOOL_DESCRIPTION.get());
@@ -203,13 +185,11 @@
      return 1;
    }
    if (argParser.usageOrVersionDisplayed())
    {
      return 0;
    }
    // Make sure that either the "ldifFile" argument or the "templateFile"
    // argument was provided, but not both.
    if (ldifFiles.isPresent())
@@ -617,7 +597,6 @@
      }
    }
    // Get information about the backends defined in the server.  Iterate
    // through them, finding the one backend into which the LDIF should be
    // imported and finding backends with subordinate base DNs that should be
@@ -747,7 +726,6 @@
      }
    }
    // See if the data should be read from LDIF files or generated via MakeLDIF.
    LDIFImportConfig importConfig;
    if (ldifFiles.isPresent())
@@ -791,7 +769,6 @@
      importConfig = new LDIFImportConfig(tf);
    }
    // Create the LDIF import configuration to use when reading the LDIF.
    importConfig.setCompressed(isCompressed.isPresent());
    importConfig.setClearBackend(clearBackend.isPresent());
@@ -876,7 +853,6 @@
    DN[] baseDNs = new DN[defaultIncludeBranches.size()];
    defaultIncludeBranches.toArray(baseDNs);
    // Acquire an exclusive lock for the backend.
    try
    {
@@ -894,7 +870,6 @@
      return 1;
    }
    // Launch the import.
    int retCode = 0;
    try
@@ -933,7 +908,6 @@
      retCode = 1;
    }
    // Release the exclusive lock on the backend.
    try
    {
@@ -951,7 +925,6 @@
      retCode = 1;
    }
    // Clean up after the import by closing the import config.
    importConfig.close();
    return retCode;