|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdata.PropsManager
public class PropsManager
Singleton class that allows save and retrieve properties
| Field Summary | |
|---|---|
private java.util.Properties |
props
Instance of properties we will use |
private static java.lang.String |
propsPath
File wich contain the properties. |
private static PropsManager |
ref
Reference of standalone class |
| Constructor Summary | |
|---|---|
private |
PropsManager()
Singleton class. |
| Method Summary | |
|---|---|
static void |
checkProps()
This method checks if there is a prop. file and a valid data folder. |
java.lang.Object |
clone()
|
static PropsManager |
getInstance()
Return the singleton instance of this class |
static java.lang.String |
getProp(java.lang.String key)
Gets the property in the current file |
void |
loadProps()
Loads previously saved Properties |
static void |
removeProp(java.lang.String key)
Removes a property from the current loaded instance |
static void |
saveProps()
Saves the current Properties |
static void |
setProp(java.lang.String key,
java.lang.String value)
Sets a key with a value in the Props. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static PropsManager ref
private static java.lang.String propsPath
private java.util.Properties props
| Constructor Detail |
|---|
private PropsManager()
| Method Detail |
|---|
public static void checkProps()
public void loadProps()
throws java.io.IOException
java.io.IOException - if something wrong
public static void saveProps()
throws java.io.IOException
java.io.IOException - if something wrong
public static void setProp(java.lang.String key,
java.lang.String value)
key - Key of the itemvalue - Value of the itempublic static void removeProp(java.lang.String key)
key - Key of the item to be deletedpublic static java.lang.String getProp(java.lang.String key)
key - Key of the property
public static PropsManager getInstance()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||