diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-27 09:44:11 -0400 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-04-28 13:34:01 -0400 |
commit | 17da8b5c94c3de3053654d83948df630ffe0d0c2 (patch) | |
tree | 4240905e54b77801a3c6aedf2866827478e64f31 | |
parent | 3ccf29c263e6e449b3b5d86c3910840c467261d9 (diff) | |
download | cbt-17da8b5c94c3de3053654d83948df630ffe0d0c2.tar.gz cbt-17da8b5c94c3de3053654d83948df630ffe0d0c2.tar.bz2 cbt-17da8b5c94c3de3053654d83948df630ffe0d0c2.zip |
minor cleanup, better logging for downloads
-rw-r--r-- | stage1/Stage1Lib.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala index 985200e..cb84310 100644 --- a/stage1/Stage1Lib.scala +++ b/stage1/Stage1Lib.scala @@ -67,9 +67,10 @@ class Stage1Lib( val logger: Logger ) extends BaseLib{ def download(url: URL, target: File, sha1: Option[String]): Boolean = { if( target.exists ){ + logger.resolver(green("found ") ++ url.string) true } else { - val incomplete = Paths.get( target.string ++ ".incomplete" ); + val incomplete = ( target ++ ".incomplete" ).toPath; val connection = url.openConnection.asInstanceOf[HttpURLConnection] if(connection.getResponseCode != HttpURLConnection.HTTP_OK){ logger.resolver(blue("not found: ") ++ url.string) @@ -91,7 +92,7 @@ class Stage1Lib( val logger: Logger ) extends BaseLib{ assert( expected == actual, s"$expected == $actual" ) logger.resolver( green("verified") ++ " checksum for " ++ target.string) } - Files.move(incomplete, Paths.get(target.string), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); + Files.move(incomplete, target.toPath, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); true } } |