|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--prupp.Config
a class to handle configs for different things. reads file on the format
[sectionName1] key=value key2=value2 [sectionName2] key=value key2=value2everything after the first '#' is considered a comment. blank lines are ignored.
Constructor Summary | |
Config()
create an empty Config (has only section "" with no data in it) |
|
Config(java.lang.String filename)
create a Config for the specified file |
Method Summary | |
java.util.Properties |
getProperties(java.lang.String sectionName)
get the properties for a given section |
java.lang.String |
getProperty(java.lang.String section,
java.lang.String key)
get a property for given key in specified section |
java.util.Enumeration |
getSections()
get the available sections |
void |
save(java.io.OutputStream os)
save the config to a OutputStream |
void |
save(java.io.OutputStream os,
java.lang.String comment)
save the config to a OutputStream |
void |
setProperties(java.lang.String sectionName,
java.util.Properties prop)
set the properties for a given section |
void |
setProperty(java.lang.String section,
java.lang.String key,
java.lang.String value)
set a property for given section. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Config()
public Config(java.lang.String filename) throws java.io.IOException
filename
- the File we read the config fromMethod Detail |
public java.util.Enumeration getSections()
public java.util.Properties getProperties(java.lang.String sectionName)
sectionName
- the section we want properties for.public void setProperties(java.lang.String sectionName, java.util.Properties prop)
sectionName
- the section we want to set the properties for.prop
- the Properties for the sectionspublic java.lang.String getProperty(java.lang.String section, java.lang.String key)
section
- the section we should look in.key
- the key we want a value for.public void setProperty(java.lang.String section, java.lang.String key, java.lang.String value)
section
- the section we should look in.key
- the key.value
- the value.public void save(java.io.OutputStream os)
public void save(java.io.OutputStream os, java.lang.String comment)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |