From 95fa171cd0f981f77a9a64aa77d9d69b81503253 Mon Sep 17 00:00:00 2001 From: Oleg <37769766+TheDearbear@users.noreply.github.com> Date: Sun, 21 Apr 2024 21:48:32 +0300 Subject: [PATCH] Remove read-only flag when deleting file (#662) --- src/main/java/de/hysky/skyblocker/utils/FileUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/de/hysky/skyblocker/utils/FileUtils.java b/src/main/java/de/hysky/skyblocker/utils/FileUtils.java index 2261144181..9bec27452f 100644 --- a/src/main/java/de/hysky/skyblocker/utils/FileUtils.java +++ b/src/main/java/de/hysky/skyblocker/utils/FileUtils.java @@ -22,6 +22,10 @@ public static void recursiveDelete(Path dir) throws IOException { }); } + if (!Files.isWritable(dir)) { + dir.toFile().setWritable(true); + } + Files.delete(dir); }