simpleini4j


License

License

Categories

Categories

ini4j Application Layer Libs Configuration
GroupId

GroupId

com.github.fracpete
ArtifactId

ArtifactId

simpleini4j
Last Version

Last Version

0.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

simpleini4j
Project Organization

Project Organization

University of Waikato, Hamilton, NZ
Source Code Management

Source Code Management

https://github.com/fracpete/simpleini4j

Download simpleini4j

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.fracpete/simpleini4j/ -->
<dependency>
    <groupId>com.github.fracpete</groupId>
    <artifactId>simpleini4j</artifactId>
    <version>0.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.fracpete/simpleini4j/
implementation 'com.github.fracpete:simpleini4j:0.0.2'
// https://jarcasting.com/artifacts/com.github.fracpete/simpleini4j/
implementation ("com.github.fracpete:simpleini4j:0.0.2")
'com.github.fracpete:simpleini4j:jar:0.0.2'
<dependency org="com.github.fracpete" name="simpleini4j" rev="0.0.2">
  <artifact name="simpleini4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.fracpete', module='simpleini4j', version='0.0.2')
)
libraryDependencies += "com.github.fracpete" % "simpleini4j" % "0.0.2"
[com.github.fracpete/simpleini4j "0.0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.commons : commons-configuration2 jar 2.7
commons-beanutils : commons-beanutils jar 1.9.3

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.2

Project Modules

There are no modules declared in this project.

simpleini4j

Wrapper for the Apache Hierarchical Configuration classes for handling INI files, to make handling easier.

Usage

Read/write

Here is how to read and write INI files:

// read
INIFile ini = INIFile.read("/some/where/config.ini");
System.out.println(ini);
// write
INIFile ini = ...
ini.write("/some/where/else/config.ini");

Operations

INIFile ini = ...

// setting
ini.set("section1", "intVal", 134);
ini.set("section1", "boolVal", false);
ini.set("section1", "doubleVal", 3.14);
System.out.println(ini);

// retrieving
System.out.println(ini.getInt("section1", "intVal"));
System.out.println(ini.getBoolean("section1", "boolVal"));
System.out.println(ini.getBoolean("section1", "doubleVal"));

// check for presence
if (ini.has("section1", "key1"))
  System.out.println("section1/key1: " + ini.get("section1", "key1"));

// remove value
ini.remove("section1", "doubleVal");
System.out.println(ini);

// remove section
ini.remove("section1");
System.out.println(ini);

Maven

Add the following dependency to your pom.xml:

  <dependency>
    <groupId>com.github.fracpete</groupId>
    <artifactId>simpleini4j</artifactId>
    <version>0.0.2</version>
  </dependency>

Versions

Version
0.0.2
0.0.1