From e27ab178fa3a2f967823c1bfc81951086e15b642 Mon Sep 17 00:00:00 2001
From: undisclosed
Date: Sun, 08 Jan 2023 16:51:38 +0000
Subject: [PATCH] Package-Namen zurueckgesetzt, weitere Anpassungen nachgezogen, Readme erneuert.

---
 src/de/uhilger/calypso/http/ApiHandler.java |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/de/uhilger/calypso/neu/http/ApiHandler.java b/src/de/uhilger/calypso/http/ApiHandler.java
similarity index 88%
rename from src/de/uhilger/calypso/neu/http/ApiHandler.java
rename to src/de/uhilger/calypso/http/ApiHandler.java
index e803df6..bcdf2a3 100644
--- a/src/de/uhilger/calypso/neu/http/ApiHandler.java
+++ b/src/de/uhilger/calypso/http/ApiHandler.java
@@ -16,14 +16,15 @@
     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
-package de.uhilger.calypso.neu.http;
+package de.uhilger.calypso.http;
 
 import com.sun.net.httpserver.HttpContext;
 import com.sun.net.httpserver.HttpExchange;
-import de.uhilger.calypso.neu.actor.PlayActor;
-import de.uhilger.calypso.neu.actor.ShellActor;
-import de.uhilger.calypso.neu.actor.StopServerActor;
+import de.uhilger.calypso.actor.PlayActor;
+import de.uhilger.calypso.actor.ShellActor;
+import de.uhilger.calypso.actor.StopServerActor;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.util.Collection;
 import java.util.Map;
 import java.util.logging.Level;
@@ -109,8 +110,14 @@
         
       case SERVER:
         if(elems[SERVERCMD].equals(STOP)) {
-          new StopServerActor().run(exchange.getHttpContext());
-          antwort = "Calypso: Der Server wird angehalten und die App beendet.";
+          try {
+            antwort = "Calypso: Der Server wird angehalten und die App beendet.";
+            sendResponse(exchange, antwort);
+            new StopServerActor().run(exchange.getHttpContext());
+          } catch (IOException ex) {
+            Logger.getLogger(ApiHandler.class.getName()).log(Level.SEVERE, null, ex);
+            antwort = "Fehler: " + ex.getLocalizedMessage();
+          }
         } else {
           antwort = elems[SERVERCMD] + " ist ein unbekanntes Serverkommando";
         }

--
Gitblit v1.9.3