From 18cd86a15ba56983ef38d0294bc1a93cb03be614 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Fri, 4 May 2018 16:07:11 +0200 Subject: [PATCH] und nochmal --- .../java2/praktikum/praktikum4/Commands.java | 30 +++++++++++++++++++ .../resources/praktikum3/vorlesungen-db.txt | 8 +++++ 2 files changed, 38 insertions(+) create mode 100644 src/main/java/de/joethei/hs/java2/praktikum/praktikum4/Commands.java create mode 100644 src/main/resources/praktikum3/vorlesungen-db.txt diff --git a/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/Commands.java b/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/Commands.java new file mode 100644 index 0000000..8c82866 --- /dev/null +++ b/src/main/java/de/joethei/hs/java2/praktikum/praktikum4/Commands.java @@ -0,0 +1,30 @@ +package de.joethei.hs.java2.praktikum.praktikum4; + +import java.io.BufferedWriter; +import java.io.IOException; + +public class Commands { + + public static class Stop implements CommandHandler { + @Override + public boolean handle(BufferedWriter writer, String[] args) { + KlausurenServer.getExecutorService().shutdown(); + System.exit(0); + + return true; + } + } + + public static class Test implements CommandHandler { + + @Override + public boolean handle(BufferedWriter writer, String[] args) { + try { + writer.write("Hallo Welt\n"); + } catch (IOException e) { + e.printStackTrace(); + } + return true; + } + } +} \ No newline at end of file diff --git a/src/main/resources/praktikum3/vorlesungen-db.txt b/src/main/resources/praktikum3/vorlesungen-db.txt new file mode 100644 index 0000000..59b11ad --- /dev/null +++ b/src/main/resources/praktikum3/vorlesungen-db.txt @@ -0,0 +1,8 @@ +A1:Relativitätstheorie:Einstein:15 +B2:Quantenmechanik:Heisenberg:17 +C2:Quantenphysik:Planck:5 +T4:Thermodynamik:Kelvin:78 +C2:Theoretische Physik:Kelvin:54 +B2:Thermodynamik:Planck:44 +T4:Quantenphysik:Planck:45 +B2:Elektrodynamik:Kelvin:34 \ No newline at end of file