]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/ServerConstants.java
[UPDATE-CONFIG] Use 3 hosts www, secure and static.
[gigi.git] / src / org / cacert / gigi / util / ServerConstants.java
index 82b124c42f5391a6f8a23273581ed515d0d2cfaf..28a52eb4e924332fc9726ed35473209fac42ac31 100644 (file)
@@ -1,5 +1,38 @@
 package org.cacert.gigi.util;
 
+import java.util.Properties;
+
 public class ServerConstants {
-       public static final String NORMAL_HOST_NAME = "http://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 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");
+       }
+       public static String getSecureHostName() {
+               return secureHostName;
+       }
+       public static String getStaticHostName() {
+               return staticHostName;
+       }
+       public static String getWwwHostName() {
+               return wwwHostName;
+       }
+       public static String getSecureHostNamePort() {
+               return secureHostName + port;
+       }
+       public static String getStaticHostNamePort() {
+               return staticHostName + port;
+       }
+       public static String getWwwHostNamePort() {
+               return wwwHostName + port;
+       }
+
 }