From 75d393e211baa079b1ef9c5dcf6f27c94c842db2 Mon Sep 17 00:00:00 2001 From: CrazyCloudCraft | Argantiu <95505222+CrazyCloudCraft@users.noreply.github.com> Date: Mon, 10 Oct 2022 08:50:21 +0200 Subject: [PATCH] Delete AutoUpdate.java --- .../world/autoupdater/AutoUpdate.java | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 src/main/java/de/butzlabben/world/autoupdater/AutoUpdate.java diff --git a/src/main/java/de/butzlabben/world/autoupdater/AutoUpdate.java b/src/main/java/de/butzlabben/world/autoupdater/AutoUpdate.java deleted file mode 100644 index 040bde5..0000000 --- a/src/main/java/de/butzlabben/world/autoupdater/AutoUpdate.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.butzlabben.world.autoupdater; - -import java.io.FileOutputStream; -import java.io.IOException; -import java.net.URL; -import java.nio.channels.Channels; -import java.nio.channels.FileChannel; -import java.nio.channels.ReadableByteChannel; - -/** - * @author Butzlabben - * @since 02.05.2018 - */ -public class AutoUpdate implements Runnable { - - private final UpdateInformations ui; - private final String jar; - - protected AutoUpdate(UpdateInformations ui, String jar) { - this.ui = ui; - this.jar = jar; - } - - @Override - public void run() { - FileChannel out = null; - FileOutputStream outStream = null; - try { - - ReadableByteChannel in = Channels - .newChannel(new URL(ui.getURL()).openStream()); - outStream = new FileOutputStream(jar); - out = outStream.getChannel(); - out.transferFrom(in, 0, Long.MAX_VALUE); - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (out != null) - try { - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - if (outStream != null) { - try { - outStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - } -}