From 17da8b5c94c3de3053654d83948df630ffe0d0c2 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Wed, 27 Apr 2016 09:44:11 -0400 Subject: minor cleanup, better logging for downloads --- stage1/Stage1Lib.scala | 5 +++-- 1 file 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 } } -- cgit v1.2.3