def download()

in src/main/scala/org/intellij/scala/bundle/package.scala [27:38]


  def download(source: URL, destination: File): Unit = {
    try {
      val input = new BufferedInputStream(source.openConnection().getInputStream)
      val output = new BufferedOutputStream(new FileOutputStream(destination))
      IOUtils.copy(input, output)
      output.close()
      input.close()
    } catch {
      case _: Throwable =>
        if (!destination.delete()) destination.deleteOnExit()
    }
  }