From afe3b2093831bcef2874e85d0c15142a38506d92 Mon Sep 17 00:00:00 2001 From: Badbird-5907 <50347938+Badbird-5907@users.noreply.github.com> Date: Sat, 23 Jul 2022 22:13:05 -0400 Subject: [PATCH] delete file --- .../java/dev/badbird/serverlauncher/config/PluginConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/badbird/serverlauncher/config/PluginConfig.java b/src/main/java/dev/badbird/serverlauncher/config/PluginConfig.java index 0c4edce..845a2ae 100644 --- a/src/main/java/dev/badbird/serverlauncher/config/PluginConfig.java +++ b/src/main/java/dev/badbird/serverlauncher/config/PluginConfig.java @@ -44,7 +44,6 @@ public void download() { } if (artifact != null) { InputStream is = build.details().downloadArtifact(artifact); - if (file.exists()) file.delete(); //download the file downloadFile(file, is); } @@ -55,6 +54,7 @@ public void download() { } public void downloadFile(File file, InputStream is) throws IOException { + if (file.exists()) file.delete(); FileOutputStream fos = new FileOutputStream(file); byte[] buffer = new byte[1024]; int len;