|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ORG.oclc.util.IniFile
IniFile reads, indexes and provides access to 'windows' type .ini files
Field Summary | |
String |
fileName
|
static String |
rootDir
|
Constructor Summary | |
IniFile()
Constructs a new IniFile object. |
|
IniFile(InputStream inputStream)
Create a new IniFile object |
|
IniFile(Reader reader)
Create a new IniFile object |
|
IniFile(String fileName)
|
|
IniFile(String fileName,
boolean preserveOrder)
|
Method Summary | |
static void |
clearIncludeDataCache()
|
protected void |
dump(PrintStream ps)
|
Vector |
getAllIncludeFileNames()
|
Vector |
getAllIncludes()
|
boolean |
getBooleanValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
boolean |
getBooleanValue(String mainKey,
String subKey,
boolean defaultValue)
Given a section name, return the boolean value(true/false) specified for the input key |
byte |
getByteValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
byte |
getByteValue(String mainKey,
String subKey,
byte defaultValue)
Given a section name, return the value specified for the input key |
double |
getDoubleValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
double |
getDoubleValue(String mainKey,
String subKey,
double defaultValue)
Given a section name, return the value specified for the input key |
float |
getFloatValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
float |
getFloatValue(String mainKey,
String subKey,
float defaultValue)
Given a section name, return the Float value specified for the input key - use for numeric values |
int |
getIntValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
int |
getIntValue(String mainKey,
String subKey,
int defaultValue)
Given a section name, return the Integer value specified for the input key - use for numeric values |
long |
getLongValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
long |
getLongValue(String mainKey,
String subKey,
long defaultValue)
Given a section name, return the value specified for the input key |
static String |
getPath()
Gets the lookup Path for locating the inifile, by looking at the directory structure and locating the first occurrence of the file. |
IniFileSection |
getSection(String mainKey)
Retrieve all the variables in a section |
Enumeration |
getSectionKeys(String mainKey)
Retrieve all the variables in a section |
Enumeration |
getSections()
Get the section names in the inifile |
short |
getShortValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
short |
getShortValue(String mainKey,
String subKey,
short defaultValue)
Given a section name, return the value specified for the input key |
String |
getStringValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
String |
getStringValue(String mainKey,
String subKey,
String defaultValue)
Given a section name, return the value specified for the input key |
String |
getValue(String mainKey,
String subKey)
Given a section name, return the value specified for the input key |
String |
getValue(String mainKey,
String subKey,
String defaultValue)
Given a section name, return the value specified for the input key. |
static void |
main(String[] argv)
|
static String |
makeBoolean(String label,
boolean flag)
Create an Inifile string for a boolean. |
static String |
makeBoolean(String label,
boolean flag,
boolean deflt)
Create an Inifile string for a boolean. |
static String |
makeInt(String label,
int value)
Create an Inifile string for an integer. |
static String |
makeInt(String label,
int value,
int deflt)
Create an Inifile string for an integer. |
static String |
makeString(String label,
String name)
Create an Inifile string for a String. |
static String |
makeString(String label,
String name,
String deft)
Create an Inifile string for a String. |
static String |
makeString(String label,
String name,
String deft,
boolean quoteOutput)
Create an Inifile string for a String. |
String |
origFilename()
|
protected String |
printSections(Hashtable sections)
|
boolean |
putBooleanValue(String section,
String key,
boolean value)
Given a section name, key and value, add (or update) it in the IniFile object. |
boolean |
putIntValue(String section,
String key,
int value)
Given a section name, key and value, add (or update) it in the IniFile object. |
boolean |
putValue(String section,
String key,
String value)
Given a section name, key and value, add (or update) it in the IniFile object. |
static String |
readEscapedLine(IniData inid)
|
static String |
readEscapedLine(Reader reader)
Read a line from Reader and interpret embedded \ escapes. |
void |
removeKey(String section,
String key)
|
void |
removeSection(String section)
|
void |
renameSection(String oldname,
String newname)
Renames a section in the inifile with the newname. |
IniFile |
resync()
|
void |
setFilename(String filename)
|
static void |
setPath(String path)
Sets a lookup Path for locating the inifile, by looking at the directory structure and locating the first occurrence of the file. |
static void |
setRootDir(String dir)
Set the the directory path for all the inifile reads |
String |
showOrder()
|
String |
toString()
|
void |
writeIniFile()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static String rootDir
public String fileName
Constructor Detail |
public IniFile()
public IniFile(String fileName) throws IOException
public IniFile(String fileName, boolean preserveOrder) throws IOException
public IniFile(InputStream inputStream)
inputStream
- is the InputStream to readpublic IniFile(Reader reader)
reader
- is the Reader to useMethod Detail |
public static void setRootDir(String dir)
dir
- the name of the directory to pre-pend to input filenamespublic static String readEscapedLine(Reader reader) throws IniInvalidValueException, IOException
reader
- where to read frompublic static String readEscapedLine(IniData inid) throws IniInvalidValueException, IOException
public static void setPath(String path)
public static String getPath()
public void setFilename(String filename)
public String origFilename()
public static void clearIncludeDataCache()
public String showOrder()
public IniFile resync()
public void writeIniFile()
public Vector getAllIncludeFileNames()
public Vector getAllIncludes()
public boolean putIntValue(String section, String key, int value)
section
- the section namekey
- the key to look forvalue
- the value to store.public boolean putBooleanValue(String section, String key, boolean value)
section
- the section namekey
- the key to look forvalue
- the value to store.public boolean putValue(String section, String key, String value)
section
- the section namekey
- the key to look forvalue
- the value to store.public void removeSection(String section)
public void removeKey(String section, String key)
public void renameSection(String oldname, String newname)
oldname
- the old section name.newname
- the new section name.public String getValue(String mainKey, String subKey)
mainKey
- the section namesubKey
- the key to look forpublic String getValue(String mainKey, String subKey, String defaultValue)
mainKey
- the section namesubKey
- the key to look fordefaultValue
- the default valuepublic String getStringValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException
mainKey
- the section namesubKey
- the key to look forpublic String getStringValue(String mainKey, String subKey, String defaultValue)
mainKey
- the section namesubKey
- the key to look forpublic int getIntValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic int getIntValue(String mainKey, String subKey, int defaultValue)
mainKey
- the section namesubKey
- the key to look fordefaultValue
- the value to return if the key is not foundpublic float getFloatValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic float getFloatValue(String mainKey, String subKey, float defaultValue)
mainKey
- the section namesubKey
- the key to look fordefaultValue
- the value to return if the key is not foundpublic boolean getBooleanValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic boolean getBooleanValue(String mainKey, String subKey, boolean defaultValue)
mainKey
- the section namesubKey
- the key to look fordefaultValue
- the value to return if the key is not foundpublic byte getByteValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic byte getByteValue(String mainKey, String subKey, byte defaultValue)
mainKey
- the section namesubKey
- the key to look forpublic short getShortValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic short getShortValue(String mainKey, String subKey, short defaultValue)
mainKey
- the section namesubKey
- the key to look forpublic long getLongValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic long getLongValue(String mainKey, String subKey, long defaultValue)
mainKey
- the section namesubKey
- the key to look forpublic double getDoubleValue(String mainKey, String subKey) throws IniMissingSectionException, IniMissingValueException, IniInvalidValueException
mainKey
- the section namesubKey
- the key to look forpublic double getDoubleValue(String mainKey, String subKey, double defaultValue)
mainKey
- the section namesubKey
- the key to look forpublic IniFileSection getSection(String mainKey)
mainKey
- the section namepublic Enumeration getSectionKeys(String mainKey)
mainKey
- the section namepublic Enumeration getSections()
protected void dump(PrintStream ps)
protected String printSections(Hashtable sections)
public String toString()
public static String makeInt(String label, int value)
label
- the variable part of the stringvalue
- the value part of the stringpublic static String makeInt(String label, int value, int deflt)
label
- the variable part of the stringvalue
- the value part of the stringdeflt
- the default value for the variablepublic static String makeBoolean(String label, boolean flag)
label
- the variable part of the stringvalue
- the value part of the stringpublic static String makeBoolean(String label, boolean flag, boolean deflt)
label
- the variable part of the stringvalue
- the value part of the stringdeflt
- the default value for the variablepublic static String makeString(String label, String name)
label
- the variable part of the stringname
- the value part of the stringpublic static String makeString(String label, String name, String deft)
label
- the variable part of the stringname
- the value part of the stringdeft
- the default valuepublic static String makeString(String label, String name, String deft, boolean quoteOutput)
label
- the variable part of the stringname
- the value part of the stringdeft
- the default valuequoteOutput
- flag indicating to surround output with single quotespublic static void main(String[] argv)
|
Open SiteSearch 4.1.1 Final |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |