<commit_before>package org.jetbrains.sbt.project.template.activator

import java.io.{File, FileOutputStream, IOException, OutputStream}
import java.util.Locale

import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.io.HttpRequests
import com.intellij.util.net.NetUtils

/**
 * User: Dmitry.Naydanov
 * Date: 30.01.15.
 */
object ActivatorDownloadUtil {
  private val CONTENT_LENGTH_TEMPLATE: String = "${content-length}"

  def downloadContentToFile(progress: ProgressIndicator,url: String,outputFile: File) {
    val parentDirExists: Boolean = FileUtil.createParentDirs(outputFile)
    if (!parentDirExists) throw new IOException("Parent dir of '" + outputFile.getAbsolutePath + "' can not be created!")

    val out = new FileOutputStream(outputFile)
    try {
      download(progress, url, out)
    } finally out.close()
  }
<commit_msg>Using buffered stream in download util<commit_after>package org.jetbrains.sbt.project.template.activator

import java.io._

import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.util.io.FileUtil
import com.intellij.util.io.HttpRequests
import com.intellij.util.net.NetUtils

/**
 * User: Dmitry.Naydanov
 * Date: 30.01.15.
 */
object ActivatorDownloadUtil {
  private val CONTENT_LENGTH_TEMPLATE: String = "${content-length}"

  def downloadContentToFile(progress: ProgressIndicator,url: String,outputFile: File) {
    val parentDirExists: Boolean = FileUtil.createParentDirs(outputFile)
    if (!parentDirExists) throw new IOException("Parent dir of '" + outputFile.getAbsolutePath + "' can not be created!")

    val out = new BufferedOutputStream(new FileOutputStream(outputFile))
    try {
      download(progress, url, out)
    } finally out.close()
  }

{'fraction_non_alphanumeric': 0.10505836575875487, 'fraction_numerical': 0.006670372429127293, 'mean_word_length': 4.960264900662252, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5014784', 'n_tokens_mistral': 560, 'n_tokens_neox': 548, 'n_words': 119}