From 09072e41e4073030dd5e3dcfb6335a648f22b5b6 Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 3 Nov 2016 22:12:50 +0100 Subject: [PATCH] Added replace existing to plugin updater --- src/main/java/buttondevteam/lib/TBMCCoreAPI.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/buttondevteam/lib/TBMCCoreAPI.java b/src/main/java/buttondevteam/lib/TBMCCoreAPI.java index 3a8b49d..be7e772 100644 --- a/src/main/java/buttondevteam/lib/TBMCCoreAPI.java +++ b/src/main/java/buttondevteam/lib/TBMCCoreAPI.java @@ -7,7 +7,9 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; +import java.nio.file.CopyOption; import java.nio.file.Files; +import java.nio.file.StandardCopyOption; import java.util.ArrayList; import java.util.List; @@ -57,7 +59,7 @@ public final class TBMCCoreAPI { result.delete(); ret = "The downloaded JAR is too small (smnaller than 25 bytes). Am I downloading from the right place?"; } else - Files.move(result.toPath(), finalresult.toPath()); + Files.move(result.toPath(), finalresult.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (FileNotFoundException e) { ret = "Can't find JAR, the build probably failed. Build log (scroll to bottom):\nhttps://jitpack.io/com/github/TBMCPlugins/" + correctname