From 4a5221633c7f8f33fc98bbbdaf0471f9bdc9d4f2 Mon Sep 17 00:00:00 2001 From: Clement Escoffier Date: Tue, 20 Jul 2021 18:28:38 +0200 Subject: [PATCH] Avoid trying to set permissions on the cache directory on windows. --- .../quarkus/vertx/core/runtime/VertxCoreRecorder.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/extensions/vertx-core/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java b/extensions/vertx-core/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java index ed799c7014cdd..7482133f4d3cf 100644 --- a/extensions/vertx-core/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java +++ b/extensions/vertx-core/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java @@ -11,6 +11,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Set; import java.util.UUID; import java.util.concurrent.CompletableFuture; @@ -259,9 +260,13 @@ private static VertxOptions convertToVertxOptions(VertxConfiguration conf, Vertx if (!tmp.mkdirs()) { LOGGER.warnf("Unable to create Vert.x cache directory : %s", tmp.getAbsolutePath()); } - if (!(tmp.setReadable(true, false) && tmp.setWritable(true, false))) { - LOGGER.warnf("Unable to make the Vert.x cache directory (%s) world readable and writable", - tmp.getAbsolutePath()); + String os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH); + if (!os.contains("windows")) { + // Do not execute the following on windows. + if (!(tmp.setReadable(true, false) && tmp.setWritable(true, false))) { + LOGGER.warnf("Unable to make the Vert.x cache directory (%s) world readable and writable", + tmp.getAbsolutePath()); + } } }