From 0bdb112dcff891a85f076774f472a244c68dcbad Mon Sep 17 00:00:00 2001
From: ulrich
Date: Fri, 22 Nov 2024 18:13:05 +0000
Subject: [PATCH] Buildscript angepasst
---
src/de/uhilger/tango/api/AbstractHandler.java | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/de/uhilger/tango/api/AbstractHandler.java b/src/de/uhilger/tango/api/AbstractHandler.java
index ec47802..d767353 100644
--- a/src/de/uhilger/tango/api/AbstractHandler.java
+++ b/src/de/uhilger/tango/api/AbstractHandler.java
@@ -21,6 +21,9 @@
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import de.uhilger.tango.App;
+import de.uhilger.tango.entity.Einstellung;
+import de.uhilger.tango.entity.Entity;
+import de.uhilger.tango.store.Storage;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -155,4 +158,20 @@
return rb.getString(key);
}
+ protected String getEinstellung(Storage s, String key, String standardWert) {
+ Entity entity = s.read(Einstellung.class.getSimpleName(), key);
+ if (entity instanceof Einstellung) {
+ Einstellung einstellung = (Einstellung) entity;
+ Object o = einstellung.getValue();
+ if(o instanceof String) {
+ return o.toString();
+ } else {
+ return standardWert;
+ }
+ } else {
+ return standardWert;
+ }
+ }
+
+
}
--
Gitblit v1.9.3