summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-11-30 13:15:15 +0800
committerkeuin <[email protected]>2020-11-30 13:15:15 +0800
commit61ade9adad4668494dfc32da7751e1b86251dc97 (patch)
treec220fe41d0691d7ad6ed08e51d351537fa220a4f /src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java
parente59bdf4ac0b66ce683be1bbc36852bfce6f70a63 (diff)
Implementing incremental backup
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java b/src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java
deleted file mode 100644
index 1642e5c..0000000
--- a/src/main/java/com/keuin/kbackupfabric/util/ServerRestartUtil.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.keuin.kbackupfabric.util;
-
-public class ServerRestartUtil {
-
- public static void forkAndRestart() {
-// Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
-// @Override
-// public void run() {
-// // Here we restart the minecraft server
-// StringBuilder cmd = new StringBuilder();
-// cmd.append(System.getProperty("java.home")).append(File.separator).append("bin").append(File.separator).append("java ");
-// for (String jvmArg : ManagementFactory.getRuntimeMXBean().getInputArguments()) {
-// cmd.append(jvmArg + " ");
-// }
-// cmd.append("-cp ").append(ManagementFactory.getRuntimeMXBean().getClassPath()).append(" ");
-// cmd.append(MinecraftServer.class.getName()).append(" ");
-// for (String arg : args) {
-// cmd.append(arg).append(" ");
-// }
-// Runtime.getRuntime().exec(cmd.toString());
-// System.exit(0);
-// }
-// }));
- }
-
- private static void startRestartThread() {
-// (new Thread(() -> {
-//
-//
-// // kill threads
-// Set<Thread> threads = Thread.getAllStackTraces().keySet();
-// Thread currentThread = Thread.currentThread();
-// for (Thread t : threads) {
-// if(t != currentThread && t.isAlive()) {
-// t.setUncaughtExceptionHandler((t1, e) -> {
-// // set empty handler
-// });
-// //t.interrupt();
-// try {
-// t.setDaemon(true);
-// } catch (Exception ignored) {
-// }
-//
-// t.stop();
-// }
-// }
-//
-// try {
-// Thread.sleep(5000);
-// } catch (InterruptedException ignored) {
-// }
-//
-// // restart Minecraft server
-// String[] args = new String[]{};
-// MinecraftServer.main(args);
-// })).start();
- }
-}