diff --git a/src/main/java/solutions/reslate/entertainment/spigotresourcesync/synchronisation/ApacheCommonsIOSynchroniser.java b/src/main/java/solutions/reslate/entertainment/spigotresourcesync/synchronisation/ApacheCommonsIOSynchroniser.java index 36f0d62..686a007 100644 --- a/src/main/java/solutions/reslate/entertainment/spigotresourcesync/synchronisation/ApacheCommonsIOSynchroniser.java +++ b/src/main/java/solutions/reslate/entertainment/spigotresourcesync/synchronisation/ApacheCommonsIOSynchroniser.java @@ -15,6 +15,11 @@ public class ApacheCommonsIOSynchroniser implements Synchroniser { source = Path.of(root.getPath(), dest.getPath()).toFile(); } + if (source.exists() && dest.exists()) { + dest.delete(); + // Fixes an issue where sometimes, Apache Commons IO will fail to overwrite. + } + if (source.isDirectory()) { if (dest.isDirectory()) { FileUtils.copyDirectory(source, dest);