aboutsummaryrefslogtreecommitdiff
path: root/stage1/Stage1Lib.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-04-27 09:44:11 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-04-28 13:34:01 -0400
commit17da8b5c94c3de3053654d83948df630ffe0d0c2 (patch)
tree4240905e54b77801a3c6aedf2866827478e64f31 /stage1/Stage1Lib.scala
parent3ccf29c263e6e449b3b5d86c3910840c467261d9 (diff)
downloadcbt-17da8b5c94c3de3053654d83948df630ffe0d0c2.tar.gz
cbt-17da8b5c94c3de3053654d83948df630ffe0d0c2.tar.bz2
cbt-17da8b5c94c3de3053654d83948df630ffe0d0c2.zip
minor cleanup, better logging for downloads
Diffstat (limited to 'stage1/Stage1Lib.scala')
-rw-r--r--stage1/Stage1Lib.scala5
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
}
}