Class GamePropertyUtility
- java.lang.Object
-
- ch.sahits.game.openpatrician.utilities.service.GamePropertyUtility
-
@Service public class GamePropertyUtility extends java.lang.Object
Utility class to encapsulate the access to the game properties.- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 17, 2013
-
-
Field Summary
Fields Modifier and Type Field Description private LocalStorage
localStorage
private java.util.Properties
props
-
Constructor Summary
Constructors Constructor Description GamePropertyUtility()
Default constructor initializing the properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSpringProfile(java.lang.String springProfile)
Add a spring profile to the active profile list of the system properties.private java.util.Properties
createDefaultProperties()
Create a property instance with default valuesjava.util.Properties
getProperties()
Retrieve the loaded properties.private java.io.File
getPropertyFile()
private void
init()
void
loadProperties()
Load the properties from the configuration directory.void
persistProperties()
Store the Properties to file.
-
-
-
Field Detail
-
props
private java.util.Properties props
-
localStorage
private LocalStorage localStorage
-
-
Method Detail
-
init
private void init()
-
getPropertyFile
private java.io.File getPropertyFile()
-
loadProperties
public void loadProperties()
Load the properties from the configuration directory.
-
getProperties
public java.util.Properties getProperties()
Retrieve the loaded properties.- Returns:
- Properties
-
persistProperties
public void persistProperties()
Store the Properties to file.
-
createDefaultProperties
private java.util.Properties createDefaultProperties()
Create a property instance with default values- Returns:
- default Properties
-
addSpringProfile
public void addSpringProfile(java.lang.String springProfile)
Add a spring profile to the active profile list of the system properties.- Parameters:
springProfile
- name of the profile.
-
-