X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2Futil%2FServerConstants.java;h=3fd2e70e7f57a72aefff38847c811f84ab0cf7da;hb=b483cf119f5b2e63ef1c406ba97c6b7c41ed5b1f;hp=d95db1b538f2b54a2a72f91df7d0507f98ef3959;hpb=746ad94df76c1ea6ae017f8e56075fcdf0cf0d1f;p=gigi.git diff --git a/src/club/wpia/gigi/util/ServerConstants.java b/src/club/wpia/gigi/util/ServerConstants.java index d95db1b5..3fd2e70e 100644 --- a/src/club/wpia/gigi/util/ServerConstants.java +++ b/src/club/wpia/gigi/util/ServerConstants.java @@ -60,6 +60,8 @@ public class ServerConstants { private static String appName = null; + private static String appIdentifier = null; + public static void init(Properties conf) { securePort = port = ""; if ( !conf.getProperty("https.port").equals("443")) { @@ -71,7 +73,7 @@ public class ServerConstants { secureBindPort = conf.getProperty("https.bindPort", conf.getProperty("https.port")); bindPort = conf.getProperty("http.bindPort", conf.getProperty("http.port")); - suffix = conf.getProperty("name.suffix", conf.getProperty("name.www", "www.wpia.local").substring(4)); + suffix = conf.getProperty("name.suffix", "wpia.local"); HashMap hostnames = new HashMap<>(); for (Host h : Host.values()) { hostnames.put(h, conf.getProperty("name." + h.getConfigName(), h.getHostDefaultPrefix() + "." + suffix)); @@ -81,6 +83,10 @@ public class ServerConstants { if (appName == null) { throw new Error("App name missing"); } + appIdentifier = conf.getProperty("appIdentifier"); + if (appIdentifier == null) { + throw new Error("App identifier missing"); + } } public static String getHostName(Host h) { @@ -150,4 +156,11 @@ public class ServerConstants { return appName; } + public static String getAppIdentifier() { + if (appIdentifier == null) { + throw new Error("AppIdentifier not initialized."); + } + return appIdentifier; + } + }