|
Version: 1.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biomoby.registry.rdfagent.util.Config
public class Config
a class to handle configs for different things. reads file on the format
[sectionName1] key=value key2=value2 [sectionName2] key=value key2=value2 key_with_equals\=still_key=value3everything after the first '#' is considered a comment. blank lines are ignored. If you want keys with '=' in them escape it to '\=' and you should be fine.
| Constructor Summary | |
|---|---|
Config(String filename)
Create a Config for the specified file |
|
| Method Summary | |
|---|---|
Properties |
getProperties(String sectionName)
get the properties for a given section |
String |
getProperty(String section,
String key,
String defaultstring)
get a property for given key in specified section |
Enumeration |
getSections()
get the available sections |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Config(String filename)
throws IOException
filename - the File we read the config from
IOException| Method Detail |
|---|
public Enumeration getSections()
public Properties getProperties(String sectionName)
sectionName - the section we want properties for.
public String getProperty(String section,
String key,
String defaultstring)
section - the section we should look in.key - the key we want a value for.defaultstring - the string to use if no value is found.
|
Version: 1.1.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||