]> WPIA git - gigi.git/blob - src/org/cacert/gigi/util/ServerConstants.java
Format code according do BenBE's 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
7     private static String wwwHostName = "www.cacert.local";
8
9     private static String secureHostName = "secure.cacert.local";
10
11     private static String staticHostName = "static.cacert.local";
12
13     private static String apiHostName = "api.cacert.local";
14
15     private static String port;
16
17     public static void init(Properties conf) {
18         port = "";
19         if ( !conf.getProperty("port").equals("443")) {
20             port = ":" + conf.getProperty("port");
21         }
22         wwwHostName = conf.getProperty("name.www");
23         secureHostName = conf.getProperty("name.secure");
24         staticHostName = conf.getProperty("name.static");
25         apiHostName = conf.getProperty("name.api");
26     }
27
28     public static String getSecureHostName() {
29         return secureHostName;
30     }
31
32     public static String getStaticHostName() {
33         return staticHostName;
34     }
35
36     public static String getWwwHostName() {
37         return wwwHostName;
38     }
39
40     public static String getApiHostName() {
41         return apiHostName;
42     }
43
44     public static String getSecureHostNamePort() {
45         return secureHostName + port;
46     }
47
48     public static String getStaticHostNamePort() {
49         return staticHostName + port;
50     }
51
52     public static String getWwwHostNamePort() {
53         return wwwHostName + port;
54     }
55
56     public static String getApiHostNamePort() {
57         return apiHostName + port;
58     }
59
60 }