X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Futil%2FServerConstants.java;h=2f22d4396b4a38abfe26ed99149a4b1849ae8317;hp=c2d7fd853a9a2be010334d52d760a167635efd1e;hb=fc2fcf0b35bf4cde8f4a9c7243de3306e8b4b55b;hpb=b0ab4664edfc6ee90b658bfa662a54dec42879b3 diff --git a/src/org/cacert/gigi/util/ServerConstants.java b/src/org/cacert/gigi/util/ServerConstants.java index c2d7fd85..2f22d439 100644 --- a/src/org/cacert/gigi/util/ServerConstants.java +++ b/src/org/cacert/gigi/util/ServerConstants.java @@ -1,5 +1,46 @@ package org.cacert.gigi.util; +import java.util.Properties; + public class ServerConstants { - public static final String NORMAL_HOST_NAME = "www.cacert.org"; + private static String wwwHostName = "www.cacert.local"; + private static String secureHostName = "secure.cacert.local"; + private static String staticHostName = "static.cacert.local"; + private static String apiHostName = "api.cacert.local"; + private static String port; + public static void init(Properties conf) { + port = ""; + if (!conf.getProperty("port").equals("443")) { + port = ":" + conf.getProperty("port"); + } + wwwHostName = conf.getProperty("name.www"); + secureHostName = conf.getProperty("name.secure"); + staticHostName = conf.getProperty("name.static"); + apiHostName = conf.getProperty("name.api"); + } + public static String getSecureHostName() { + return secureHostName; + } + public static String getStaticHostName() { + return staticHostName; + } + public static String getWwwHostName() { + return wwwHostName; + } + public static String getApiHostName() { + return apiHostName; + } + public static String getSecureHostNamePort() { + return secureHostName + port; + } + public static String getStaticHostNamePort() { + return staticHostName + port; + } + public static String getWwwHostNamePort() { + return wwwHostName + port; + } + public static String getApiHostNamePort() { + return apiHostName + port; + } + }