View Javadoc

1   /*
2   Copyright 2010 James Pether Sörling Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
3   	$Id
4   */
5   package com.hack23.cia.model.application.dto.common;
6   
7   import java.io.IOException;
8   import java.util.Properties;
9   
10  /***
11   * The Class ApplicationProperties.
12   */
13  public class ApplicationProperties {
14  
15      /*** The properties. */
16      private final Properties properties = new Properties();
17  
18      /***
19       * Instantiates a new application properties.
20       */
21      public ApplicationProperties() {
22          super();
23          try {
24              properties.load(ApplicationProperties.class
25                      .getResourceAsStream("/application.properties"));
26          } catch (final IOException e) {
27          	e.printStackTrace();
28          }
29      }
30  
31      /***
32       * Gets the name.
33       *
34       * @return the name
35       */
36      public final String getName() {
37          return properties.getProperty("application.name");
38      }
39  
40      /***
41       * Gets the url.
42       *
43       * @return the url
44       */
45      public final String getUrl() {
46          return properties.getProperty("application.url");
47      }
48  
49      /***
50       * Gets the version.
51       *
52       * @return the version
53       */
54      public final String getVersion() {
55          return properties.getProperty("application.version");
56      }
57  
58  
59  }