]> WPIA git - gigi.git/blob - src/org/cacert/gigi/util/ServerConstants.java
[EMPTY] Formatting with configured formatter.
[gigi.git] / src / org / cacert / gigi / util / ServerConstants.java
1 package org.cacert.gigi.util;
2
3 import java.util.Properties;
4
5 public class ServerConstants {
6         private static String wwwHostName = "www.cacert.local";
7         private static String secureHostName = "secure.cacert.local";
8         private static String staticHostName = "static.cacert.local";
9         private static String apiHostName = "api.cacert.local";
10         private static String port;
11
12         public static void init(Properties conf) {
13                 port = "";
14                 if (!conf.getProperty("port").equals("443")) {
15                         port = ":" + conf.getProperty("port");
16                 }
17                 wwwHostName = conf.getProperty("name.www");
18                 secureHostName = conf.getProperty("name.secure");
19                 staticHostName = conf.getProperty("name.static");
20                 apiHostName = conf.getProperty("name.api");
21         }
22
23         public static String getSecureHostName() {
24                 return secureHostName;
25         }
26
27         public static String getStaticHostName() {
28                 return staticHostName;
29         }
30
31         public static String getWwwHostName() {
32                 return wwwHostName;
33         }
34
35         public static String getApiHostName() {
36                 return apiHostName;
37         }
38
39         public static String getSecureHostNamePort() {
40                 return secureHostName + port;
41         }
42
43         public static String getStaticHostNamePort() {
44                 return staticHostName + port;
45         }
46
47         public static String getWwwHostNamePort() {
48                 return wwwHostName + port;
49         }
50
51         public static String getApiHostNamePort() {
52                 return apiHostName + port;
53         }
54
55 }