java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.base.IniFileEditor |
A reader-and-writer for ini
configuration files.
Example of a valid ini file:
[section1] foo bar [section2] x y [section3] [section4] z
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
IniFileEditor(File file) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
List<String> |
getSectionContents(String sectionName)
Retrieve the contents of a section.
| ||||||||||
List<String> |
getSectionNames()
Retrieve the list of sections in the ini file.
| ||||||||||
String |
getValue(String sectionName, String keyName, String delimiter)
Retrieve a value.
| ||||||||||
String |
getValue(String sectionName, String keyName)
Retrieve a value.
| ||||||||||
void |
setSectionContents(String sectionName, List<String> contents)
Set the contents of a new section.
| ||||||||||
boolean |
setValue(String sectionName, String keyName, String value, String delimiter)
Set a value.
| ||||||||||
boolean |
setValue(String sectionName, String keyName, String value)
Set a value.
| ||||||||||
void |
update()
Update the original ini file.
| ||||||||||
void |
write(File newFile)
Write the updated contents to a new ini file.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
IOException |
---|
Retrieve the contents of a section.
Retrieve the list of sections in the ini file.
Retrieve a value.
Retrieve a value.
sectionName | section name |
---|---|
keyName | key name |
Set the contents of a new section. The section is created if it does not exist.
sectionName | section name (without bracket) |
---|---|
contents | blank lines are not added |
Set a value.
Set a value.
Update the original ini file.
IOException |
---|
Write the updated contents to a new ini file.
IOException |
---|