Replace usages of scala.io.Source with NIO

This commit is contained in:
Alexandre Archambault 2016-01-31 21:06:05 +01:00
parent fc237d61ad
commit 5f9f854562
1 changed files with 3 additions and 3 deletions

View File

@ -357,8 +357,8 @@ object Cache {
artifact0.checksumUrls.get(sumType) match { artifact0.checksumUrls.get(sumType) match {
case Some(sumFile) => case Some(sumFile) =>
Task { Task {
val sum = scala.io.Source.fromFile(sumFile) val sum = new String(NioFiles.readAllBytes(new File(sumFile).toPath), "UTF-8")
.getLines() .linesIterator
.toStream .toStream
.headOption .headOption
.mkString .mkString
@ -471,7 +471,7 @@ object Cache {
pool = pool pool = pool
).leftMap(_.message).map { f => ).leftMap(_.message).map { f =>
// FIXME Catch error here? // FIXME Catch error here?
scala.io.Source.fromFile(f)("UTF-8").mkString new String(NioFiles.readAllBytes(f.toPath), "UTF-8")
} }
} }