From 0259f4676a6fad731b4b16b3620c358afdb42fdc Mon Sep 17 00:00:00 2001
From: undisclosed
Date: Sun, 22 Jan 2023 14:32:22 +0000
Subject: [PATCH] Experimentell: JavaScript-Player fuer 'hier spielen' bei Abspiellisten

---
 src/de/uhilger/tango/api/AbstractHandler.java |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/de/uhilger/tango/api/AbstractHandler.java b/src/de/uhilger/tango/api/AbstractHandler.java
index 9afb94e..ec47802 100644
--- a/src/de/uhilger/tango/api/AbstractHandler.java
+++ b/src/de/uhilger/tango/api/AbstractHandler.java
@@ -20,11 +20,13 @@
 import com.sun.net.httpserver.Headers;
 import com.sun.net.httpserver.HttpExchange;
 import com.sun.net.httpserver.HttpHandler;
+import de.uhilger.tango.App;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
+import java.util.ResourceBundle;
 import java.util.logging.Logger;
 
 
@@ -53,6 +55,8 @@
   public static final int RTC_NOT_FOUND = 404;
   
   protected int returnCode;
+  
+  private ResourceBundle rb;
 
   public AbstractHandler() {
     this.returnCode = RTC_OK;
@@ -126,7 +130,7 @@
     return "nicht unterstuetzt";
   }
 
-  protected String post(HttpExchange e) {
+  protected String post(HttpExchange e) throws IOException {
     setReturnCode(RTC_NOT_FOUND);
     return "nicht unterstuetzt";
   }
@@ -144,4 +148,11 @@
   protected abstract boolean delete(HttpExchange e);
   */
   
+  protected String getResString(String key) {
+    if(rb == null) {
+      rb = ResourceBundle.getBundle(App.RB_NAME);
+    }
+    return rb.getString(key);
+  }
+  
 }

--
Gitblit v1.9.3