Java API for handling Windows ini file format

The [ini4j] is a simple Java API for handling configuration files in Windows .ini format. Additionally, the library includes Java Preferences API implementation based on the .ini file.

  • Tutorials
  • Download
  • Community
  • Simple document model

    [ini4j] has very simple, but intuitive document model for windows .ini files. Basicly it is two level of Maps. You can use full power of Collections API. The Ini (Wini) class is map of Sections. Section is map of name/value pairs (options). --> Ini Tutorial

    Multiply option/section values

    In addition of model above, [ini4j] is able to deal with multiply option/section entries. It can be handled with MultiMap interface, which simply extends Map interface, and allow multiply values per key.

    Expression handling

    Many .ini files contains same values more than one times. With [ini4j] you are able to refer other options value via simple macro substitution. The basic syntax is the commonly used ${REF} format: ${section/option} (or with multi option: ${section/option[index]})

    java.util.Properties replacement

    [ini4j] contains class Options which is a better Properties replacement. Options use .properties file format, but allow macro/variable substitution, mult value properties. Unlike original java.util.Properties, Options implements Map<String,String>, so it more confortable to use standard Collections api. --> Options Tutorial

    Read/write Windows registry

    Yes, it is possible now to read/write registry from java programs without native (JNI) code ! [ini4j] is able to read and write registry keys. And almost all .ini features (expression handling, multi value, bean interface, etc) works with windows registry. --> Windows Registry Tutorial

    Handle .REG file format

    On windows systems .REG file is common for registry import/export. It has similar but bit different syntax than old .ini format. [ini4j] fully support .REG file format. --> Reg Tutorial