more accurate Files.isRegularFile, exclude directories (e.g. jar_path);
authorwenzelm
Tue, 09 Nov 2021 11:23:27 +0100
changeset 74738 cba1da393958
parent 74737 d912c1b6c1d0
child 74739 a06652d397a7
child 74749 329cb9e6b184
more accurate Files.isRegularFile, exclude directories (e.g. jar_path);
Admin/components/components.sha1
Admin/components/main
src/Tools/Setup/src/Build.java
--- a/Admin/components/components.sha1	Tue Nov 09 11:20:38 2021 +0100
+++ b/Admin/components/components.sha1	Tue Nov 09 11:23:27 2021 +0100
@@ -145,6 +145,7 @@
 127a75ae33e97480d352087fcb9b47a632d77169  isabelle_setup-20210724.tar.gz
 309909ec6d43ae460338e9af54c1b2a48adcb1ec  isabelle_setup-20210726.tar.gz
 a14ce46c62c64c3413f3cc9239242e33570d0f3d  isabelle_setup-20210922.tar.gz
+b22066a9dcde6f813352dcf6404ac184440a22df  isabelle_setup-20211109.tar.gz
 0b2206f914336dec4923dd0479d8cee4b904f544  jdk-11+28.tar.gz
 e12574d838ed55ef2845acf1152329572ab0cc56  jdk-11.0.10+9.tar.gz
 3e05213cad47dbef52804fe329395db9b4e57f39  jdk-11.0.2+9.tar.gz
--- a/Admin/components/main	Tue Nov 09 11:20:38 2021 +0100
+++ b/Admin/components/main	Tue Nov 09 11:23:27 2021 +0100
@@ -8,7 +8,7 @@
 flatlaf-1.6
 idea-icons-20210508
 isabelle_fonts-20211004
-isabelle_setup-20210922
+isabelle_setup-20211109
 jdk-17.0.1+12
 jedit-20211103
 jfreechart-1.5.3
--- a/src/Tools/Setup/src/Build.java	Tue Nov 09 11:20:38 2021 +0100
+++ b/src/Tools/Setup/src/Build.java	Tue Nov 09 11:23:27 2021 +0100
@@ -69,7 +69,7 @@
         for (String p : Environment.getenv("ISABELLE_COMPONENTS").split(":", -1)) {
             if (!p.isEmpty()) {
                 Path dir = Path.of(Environment.platform_path(p));
-                if (Files.exists(dir.resolve(COMPONENT_BUILD_PROPS))) {
+                if (Files.isRegularFile(dir.resolve(COMPONENT_BUILD_PROPS))) {
                     result.add(component_context(dir));
                 }
             }
@@ -151,11 +151,6 @@
         {
             return _dir.resolve(Environment.expand_platform_path(file));
         }
-        public boolean exists(String file)
-            throws IOException, InterruptedException
-        {
-            return Files.exists(path(file));
-        }
 
         public List<Path> requirement_paths(String s)
             throws IOException, InterruptedException
@@ -190,12 +185,12 @@
         {
             MessageDigest sha = MessageDigest.getInstance("SHA");
             for (Path file : paths) {
-                if (Files.exists(file)) {
+                if (Files.isRegularFile(file)) {
                     sha.update(Files.readAllBytes(file));
                 }
                 else {
                     throw new RuntimeException(
-                        error_message("Missing input file " + Library.quote(file.toString())));
+                        error_message("Bad input file " + Library.quote(file.toString())));
                 }
             }
             return sha_digest(sha, name);
@@ -338,7 +333,7 @@
     public static List<String> get_services(Path jar_path)
         throws IOException
     {
-        if (Files.exists(jar_path)) {
+        if (Files.isRegularFile(jar_path)) {
             try (JarFile jar_file = new JarFile(jar_path.toFile()))
             {
                 JarEntry entry = jar_file.getJarEntry(SERVICES);