mirror of https://github.com/sbt/sbt.git
Replace usages of scala.io.Source with NIO
This commit is contained in:
parent
fc237d61ad
commit
5f9f854562
|
|
@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue