From 565ebe81611ca1ff0b1db8f3aa35bfb47f5737f5 Mon Sep 17 00:00:00 2001 From: Oleg <37769766+TheDearbear@users.noreply.github.com> Date: Sat, 20 Apr 2024 15:42:54 +0300 Subject: [PATCH] Remove read-only flag when deleting file --- 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); }