aboutsummaryrefslogtreecommitdiff
path: root/stage2/Lib.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2016-04-27 09:35:17 -0400
committerChristopher Vogt <oss.nsp@cvogt.org>2016-04-28 13:34:01 -0400
commit820e06bc132dc4363a6cc7869ccc96c830e17018 (patch)
treebd4dc74eab66e8e7c398ea5fe7ed7b25966efe61 /stage2/Lib.scala
parent74ddcf55ccf0fb4c87b4b0ea06f95a6a419f262f (diff)
downloadcbt-820e06bc132dc4363a6cc7869ccc96c830e17018.tar.gz
cbt-820e06bc132dc4363a6cc7869ccc96c830e17018.tar.bz2
cbt-820e06bc132dc4363a6cc7869ccc96c830e17018.zip
from from File to Path directly
Diffstat (limited to 'stage2/Lib.scala')
-rw-r--r--stage2/Lib.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/stage2/Lib.scala b/stage2/Lib.scala
index 3c5ff3a..aa98e7c 100644
--- a/stage2/Lib.scala
+++ b/stage2/Lib.scala
@@ -208,7 +208,8 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{
// file system helpers
def basename(path: File): String = path.toString.stripSuffix("/").split("/").last
def dirname(path: File): File = new File(realpath(path).string.stripSuffix("/").split("/").dropRight(1).mkString("/"))
- def nameAndContents(file: File) = basename(file) -> readAllBytes(Paths.get(file.toString))
+ def nameAndContents(file: File) = basename(file) -> readAllBytes(file.toPath)
+
/** Which file endings to consider being source files. */
def sourceFileFilter(file: File): Boolean = file.toString.endsWith(".scala") || file.toString.endsWith(".java")
@@ -238,7 +239,7 @@ final class Lib(logger: Logger) extends Stage1Lib(logger) with Scaffold{
val entry = new JarEntry( name )
entry.setTime(file.lastModified)
jar.putNextEntry(entry)
- jar.write( readAllBytes( Paths.get(file.toString) ) )
+ jar.write( readAllBytes( file.toPath ) )
jar.closeEntry
name
}