nwnintf
Class IniParser
java.lang.Object
|
+--nwnintf.IniParser
- public class IniParser
- extends java.lang.Object
Quick and dirty parser for windows-format .ini files.
java.util.prefs.Preferences lets us store keys in the registry,
but only in a sandbox that doesn't let us grab keys from anywhere
we want.
Everything goes under either
\\HKLM\SOFTWARE\JavaSoft\Prefs
\\HKCU\Software\JavaSoft\Prefs
Constructor Summary |
IniParser(java.io.File f)
|
Method Summary |
java.lang.String |
get(java.lang.String section,
java.lang.String key)
Retrieve a key from the section of the inifile. |
static void |
main(java.lang.String[] args)
command-line test |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IniParser
public IniParser(java.io.File f)
- Parameters:
f
- The .ini file.
get
public java.lang.String get(java.lang.String section,
java.lang.String key)
throws java.io.IOException
- Retrieve a key from the section of the inifile.
- Parameters:
section
- Name of the section to look for the key in.key
- Name of the key.
- Returns:
- value of the key. Null if the section of key did not exist.
java.io.IOException
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- command-line test
java.lang.Exception