From 820e06bc132dc4363a6cc7869ccc96c830e17018 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Wed, 27 Apr 2016 09:35:17 -0400 Subject: from from File to Path directly --- stage2/Lib.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'stage2') 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 } -- cgit v1.2.3