1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.hack23.cia.web.impl.ui.common;
20
21 import java.io.IOException;
22 import java.util.Properties;
23
24 import org.slf4j.Logger;
25 import org.slf4j.LoggerFactory;
26
27
28
29
30 public final class ApplicationProperties {
31
32 private ApplicationProperties() {
33 super();
34 }
35
36 private final static Logger LOGGER = LoggerFactory
37 .getLogger(ApplicationProperties.class);
38
39
40 private static Properties properties = new Properties();
41
42 static {
43 try {
44 properties.load(ApplicationProperties.class
45 .getResourceAsStream("/application.properties"));
46 } catch (final IOException e) {
47 LOGGER.warn("Add msg",e);
48 }
49 }
50
51
52
53
54
55
56 public static String getName() {
57 return properties.getProperty("application.name");
58 }
59
60
61
62
63
64
65 public static String getUrl() {
66 return properties.getProperty("application.url");
67 }
68
69
70
71
72
73
74 public static String getVersion() {
75 return properties.getProperty("application.version");
76 }
77
78 }