mirror of https://github.com/sbt/sbt.git
Cleaning
This commit is contained in:
parent
4391859a72
commit
7c8215396c
|
|
@ -63,19 +63,19 @@ case class ArtifactDownloader(root: String, cache: File, logger: Option[Artifact
|
||||||
val in = new BufferedInputStream(url.openStream(), bufferSize)
|
val in = new BufferedInputStream(url.openStream(), bufferSize)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val w = new FileOutputStream(file)
|
val out = new FileOutputStream(file)
|
||||||
try {
|
try {
|
||||||
@tailrec
|
@tailrec
|
||||||
def helper(): Unit = {
|
def helper(): Unit = {
|
||||||
val read = in.read(b)
|
val read = in.read(b)
|
||||||
if (read >= 0) {
|
if (read >= 0) {
|
||||||
w.write(b, 0, read)
|
out.write(b, 0, read)
|
||||||
helper()
|
helper()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
helper()
|
helper()
|
||||||
} finally w.close()
|
} finally out.close()
|
||||||
} finally in.close()
|
} finally in.close()
|
||||||
|
|
||||||
logger.foreach(_.downloadedArtifact(urlStr, success = true))
|
logger.foreach(_.downloadedArtifact(urlStr, success = true))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue