Skip to content

Commit

Permalink
Merge pull request #18867 from cescoffier/fix-windows-cache-directory…
Browse files Browse the repository at this point in the history
…-warning

Avoid trying to set permissions on the cache directory on windows
  • Loading branch information
rsvoboda authored Jul 23, 2021
2 parents 590a49e + 4a52216 commit 08afe29
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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;
Expand Down Expand Up @@ -305,9 +306,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());
}
}
}

Expand Down

0 comments on commit 08afe29

Please sign in to comment.