|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectarchivo3000.INIFile
public final class INIFile
INIFile class provides methods for manipulating (Read/Write) windows ini files.
Constructor Summary | |
---|---|
INIFile(java.lang.String pstrPathAndName)
Create a iniFile object from the file named in the parameter. |
Method Summary | |
---|---|
void |
addSection(java.lang.String pstrSection,
java.lang.String pstrComments)
Sets the comments associated with a section. |
java.lang.String[] |
getAllSectionNames()
Returns a string array containing names of all sections in INI file. |
java.lang.Boolean |
getBooleanProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified boolean property from the specified section. |
java.util.Date |
getDateProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified date property from the specified section. |
java.lang.Double |
getDoubleProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified double property from the specified section. |
java.lang.String |
getFileName()
Returns the ini file name being used. |
java.lang.Integer |
getIntegerProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified integer property from the specified section. |
java.lang.Long |
getLongProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified long property from the specified section. |
java.util.Map |
getProperties(java.lang.String pstrSection)
Returns a map containing all the properties under specified section. |
java.lang.String[] |
getPropertyNames(java.lang.String pstrSection)
Returns a string array containing names of all the properties under specified section. |
java.lang.String |
getStringProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified string property from the specified section. |
java.util.Date |
getTimestampProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Returns the specified date property from the specified section. |
int |
getTotalSections()
|
void |
removeProperty(java.lang.String pstrSection,
java.lang.String pstrProp)
Removed specified property from the specified section. |
void |
removeSection(java.lang.String pstrSection)
Removes the specified section if one exists, otherwise does nothing. |
boolean |
save()
Flush changes back to the disk file. |
void |
setBooleanProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
boolean pblnVal,
java.lang.String pstrComments)
Sets the specified boolean property. |
void |
setDateFormat(java.lang.String pstrDtFmt)
Sets the format to be used to interpreat date values. |
void |
setDateProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
java.util.Date pdtVal,
java.lang.String pstrComments)
Sets the specified java.util.Date property. |
void |
setDoubleProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
double pdblVal,
java.lang.String pstrComments)
Sets the specified double property. |
void |
setIntegerProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
int pintVal,
java.lang.String pstrComments)
Sets the specified integer property. |
void |
setLongProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
long plngVal,
java.lang.String pstrComments)
Sets the specified long property. |
void |
setStringProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
java.lang.String pstrVal,
java.lang.String pstrComments)
Sets the specified string property. |
void |
setTimeStampFormat(java.lang.String pstrTSFmt)
Sets the format to be used to interpreat timestamp values. |
void |
setTimestampProperty(java.lang.String pstrSection,
java.lang.String pstrProp,
java.sql.Timestamp ptsVal,
java.lang.String pstrComments)
Sets the specified java.sql.Timestamp property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public INIFile(java.lang.String pstrPathAndName)
pstrPathAndName
- The full path and name of the ini file to be used.Method Detail |
---|
public java.lang.String getFileName()
public java.lang.String getStringProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public java.lang.Boolean getBooleanProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public java.lang.Integer getIntegerProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public java.lang.Long getLongProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public java.lang.Double getDoubleProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public java.util.Date getDateProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public java.util.Date getTimestampProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the INI section name.pstrProp
- the property to be retrieved.
public void addSection(java.lang.String pstrSection, java.lang.String pstrComments)
pstrSection
- the section namepstrComments
- the comments.public void setStringProperty(java.lang.String pstrSection, java.lang.String pstrProp, java.lang.String pstrVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.public void setBooleanProperty(java.lang.String pstrSection, java.lang.String pstrProp, boolean pblnVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.pblnVal
- the boolean value to be persistedpublic void setIntegerProperty(java.lang.String pstrSection, java.lang.String pstrProp, int pintVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.pintVal
- the int property to be persisted.public void setLongProperty(java.lang.String pstrSection, java.lang.String pstrProp, long plngVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.plngVal
- the long value to be persisted.public void setDoubleProperty(java.lang.String pstrSection, java.lang.String pstrProp, double pdblVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.pdblVal
- the double value to be persisted.public void setDateProperty(java.lang.String pstrSection, java.lang.String pstrProp, java.util.Date pdtVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.pdtVal
- the date value to be persisted.public void setTimestampProperty(java.lang.String pstrSection, java.lang.String pstrProp, java.sql.Timestamp ptsVal, java.lang.String pstrComments)
pstrSection
- the INI section name.pstrProp
- the property to be set.ptsVal
- the timestamp value to be persisted.public void setDateFormat(java.lang.String pstrDtFmt) throws java.lang.IllegalArgumentException
pstrDtFmt
- the format string
java.lang.IllegalArgumentException
- if the if the given pattern is invalidpublic void setTimeStampFormat(java.lang.String pstrTSFmt)
pstrTSFmt
- the format string
java.lang.IllegalArgumentException
- if the if the given pattern is invalidpublic int getTotalSections()
public java.lang.String[] getAllSectionNames()
public java.lang.String[] getPropertyNames(java.lang.String pstrSection)
pstrSection
- the name of the section for which names of properties is to be retrieved.
public java.util.Map getProperties(java.lang.String pstrSection)
pstrSection
- the name of the section for which properties are to be retrieved.
public void removeProperty(java.lang.String pstrSection, java.lang.String pstrProp)
pstrSection
- the section name.pstrProp
- the name of the property to be removed.public void removeSection(java.lang.String pstrSection)
pstrSection
- the name of the section to be removed.public boolean save()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |