private void createLdifFile(BufferedReader schemaExportReader,String ldapSchemaFileName) throws IOException, FileOperationFailedException {
  _log.info("Ldif file {}",ldapSchemaFileName);
  File ldapSchemaExportFile=new File(ldapSchemaFileName);
  if (ldapSchemaExportFile.exists()) {
    if (!ldapSchemaExportFile.delete()) {
      throw new FileOperationFailedException("delete","file",ldapSchemaFileName);
    }
  }
  if (!ldapSchemaExportFile.createNewFile()) {
    throw new FileOperationFailedException("create","file",ldapSchemaFileName);
  }
  if (!ldapSchemaExportFile.setWritable(true)) {
    throw new FileOperationFailedException("set writable","file",ldapSchemaFileName);
  }
  ldapSchemaExportFile.deleteOnExit();
  BufferedWriter writer=new BufferedWriter(new FileWriter(ldapSchemaExportFile));
  String line;
  while ((line=schemaExportReader.readLine()) != null) {
    writer.write(line);
    writer.newLine();
  }
  writer.close();
}

private void createLdifFile ( BufferedReader schemaExportReader , String ldapSchemaFileName ) throws IOException , FileOperationFailedException { _log . info ( "Ldif file {}" , ldapSchemaFileName ) ; File ldapSchemaExportFile = new File ( ldapSchemaFileName ) ; if ( ldapSchemaExportFile . exists ( ) ) { if ( ! ldapSchemaExportFile . delete ( ) ) { throw new FileOperationFailedException ( "delete" , "file" , ldapSchemaFileName ) ; } } if ( ! ldapSchemaExportFile . createNewFile ( ) ) { throw new FileOperationFailedException ( "create" , "file" , ldapSchemaFileName ) ; } if ( ! ldapSchemaExportFile . setWritable ( true ) ) { throw new FileOperationFailedException ( "set writable" , "file" , ldapSchemaFileName ) ; } ldapSchemaExportFile . deleteOnExit ( ) ; BufferedWriter writer = new BufferedWriter ( new FileWriter ( ldapSchemaExportFile ) ) ; String line ; while ( ( line = schemaExportReader . readLine ( ) ) != null ) { writer . write ( line ) ; writer . newLine ( ) ; } writer . close ( ) ; }
creates a dummy ldif file under . / build directory from the source file .
