private int run(final String templatePath,final StringArgument resourcePath,final StringArgument ldifFile,final IntegerArgument randomSeedArg,final StringArgument constants,final IntegerArgument wrapColumn){
  LDIFEntryWriter writer=null;
  try (EntryGenerator generator=createGenerator(templatePath,resourcePath,randomSeedArg,constants)){
    if (generator == null) {
      return EXIT_CODE_FAILURE;
    }
    if (generator.hasWarnings()) {
      for (      LocalizableMessage warn : generator.getWarnings()) {
        errPrintln(warn);
      }
    }
    try {
      writer=createLdifWriter(ldifFile,wrapColumn);
    }
 catch (    final IOException e) {
      errPrintln(ERR_MAKELDIF_UNABLE_TO_CREATE_LDIF.get(ldifFile.getValue(),e.getMessage()));
      return EXIT_CODE_FAILURE;
    }
catch (    final ArgumentException e) {
      errPrintln(ERR_ERROR_PARSING_ARGS.get(e.getMessageObject()));
      return EXIT_CODE_FAILURE;
    }
    if (!generateEntries(generator,writer,ldifFile)) {
      return EXIT_CODE_FAILURE;
    }
    errPrintln(INFO_MAKELDIF_PROCESSING_COMPLETE.get(numberOfEntriesWritten));
    return EXIT_CODE_SUCCESS;
  }
  finally {
    closeSilently(writer);
  }
}

private int run ( final String templatePath , final StringArgument resourcePath , final StringArgument ldifFile , final IntegerArgument randomSeedArg , final StringArgument constants , final IntegerArgument wrapColumn ) { LDIFEntryWriter writer = null ; try ( EntryGenerator generator = createGenerator ( templatePath , resourcePath , randomSeedArg , constants ) ) { if ( generator == null ) { return EXIT_CODE_FAILURE ; } if ( generator . hasWarnings ( ) ) { for ( LocalizableMessage warn : generator . getWarnings ( ) ) { errPrintln ( warn ) ; } } try { writer = createLdifWriter ( ldifFile , wrapColumn ) ; } catch ( final IOException e ) { errPrintln ( ERR_MAKELDIF_UNABLE_TO_CREATE_LDIF . get ( ldifFile . getValue ( ) , e . getMessage ( ) ) ) ; return EXIT_CODE_FAILURE ; } catch ( final ArgumentException e ) { errPrintln ( ERR_ERROR_PARSING_ARGS . get ( e . getMessageObject ( ) ) ) ; return EXIT_CODE_FAILURE ; } if ( ! generateEntries ( generator , writer , ldifFile ) ) { return EXIT_CODE_FAILURE ; } errPrintln ( INFO_MAKELDIF_PROCESSING_COMPLETE . get ( numberOfEntriesWritten ) ) ; return EXIT_CODE_SUCCESS ; } finally { closeSilently ( writer ) ; } }
run make ldif with provided arguments .
