|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.petterroea.starterkit.PropertiesFile
public class PropertiesFile
Old codefile that i have used since hMod(Inspired by one of the code files in hMod). Works good^^
| Field Summary | |
|---|---|
private java.lang.String |
fileExtension
The file extension to be used |
private java.lang.String |
product
The complete file name |
private java.util.Properties |
propertiesFile
The file we are wrapping |
| Constructor Summary | |
|---|---|
PropertiesFile(java.io.File theFile)
Creates or loads a PropertiesFile based on the given file |
|
PropertiesFile(java.lang.String name)
Creates or loads a new PropertiesFile based on the given name, without a file extension |
|
| Method Summary | |
|---|---|
boolean |
containsKey(java.lang.String name)
Checks if a property/key called name exists |
boolean |
getBool(java.lang.String name)
Gets a boolean with the property behind name. |
int |
getInt(java.lang.String name)
Gets a integer with the property behind name. |
java.lang.String |
getProperty(java.lang.String name)
Gets a string with the property behind name |
java.lang.String |
getString(java.lang.String name)
Gets a string with the property behind name |
(package private) void |
reload()
Reloads the file |
void |
removeKey(java.lang.String name)
Removes the key/property from the file |
(package private) void |
save()
Saves the properties file |
void |
setBool(java.lang.String name,
boolean value)
Sets a boolean property. |
void |
setInt(java.lang.String name,
int value)
Sets a integer property. |
void |
setString(java.lang.String name,
java.lang.String value)
Sets a string property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String product
private java.util.Properties propertiesFile
private java.lang.String fileExtension
| Constructor Detail |
|---|
public PropertiesFile(java.lang.String name)
name - The file namepublic PropertiesFile(java.io.File theFile)
theFile - File to load from| Method Detail |
|---|
void reload()
throws java.io.IOException
java.io.IOExceptionvoid save()
public boolean containsKey(java.lang.String name)
name - The name to check
public void removeKey(java.lang.String name)
name - The name to removepublic java.lang.String getProperty(java.lang.String name)
name - Name of the property to get
public java.lang.String getString(java.lang.String name)
name - Name of the property to get
public void setString(java.lang.String name,
java.lang.String value)
name - Name of propertyvalue - Value of propertypublic int getInt(java.lang.String name)
name - Name of the property to get
public void setInt(java.lang.String name,
int value)
name - The name of the propertyvalue - Value to be setpublic boolean getBool(java.lang.String name)
name - Name of the property to get
public void setBool(java.lang.String name,
boolean value)
name - Name of the propertyvalue - Value of the property
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||