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