clarified IO, following Java 11 and Isabelle/Scala;
authorwenzelm
Tue, 28 Jun 2022 15:29:17 +0200
changeset 75631 809c37bfd823
parent 75630 e3aa7214eb1a
child 75632 e4bbe0b9288d
clarified IO, following Java 11 and Isabelle/Scala;
src/Pure/Admin/ci_profile.scala
--- a/src/Pure/Admin/ci_profile.scala	Tue Jun 28 15:23:05 2022 +0200
+++ b/src/Pure/Admin/ci_profile.scala	Tue Jun 28 15:29:17 2022 +0200
@@ -10,6 +10,7 @@
 import java.time.{Instant, ZoneId}
 import java.time.format.DateTimeFormatter
 import java.util.{Properties => JProperties, Map => JMap}
+import java.nio.file.Files
 
 
 object CI_Profile {
@@ -78,15 +79,13 @@
 
 
   private def load_properties(): JProperties = {
-    val props = new JProperties()
+    val props = new JProperties
     val file_name = Isabelle_System.getenv("ISABELLE_CI_PROPERTIES")
-
-    if (file_name != "") {
-      val file = Path.explode(file_name).file
-      if (file.exists()) props.load(new java.io.FileReader(file))
-      props
+    if (file_name.nonEmpty) {
+      val path = Path.explode(file_name)
+      if (path.is_file) props.load(Files.newBufferedReader(path.java_path))
     }
-    else props
+    props
   }
 
   private def compute_timing(results: Build.Results, group: Option[String]): Timing = {