Ini File - example & Cheatsheet

This tutorial covers the essentials of Ini File example and cheatsheet ..

Sample INI File example

[http]
port=8080
username=httpuser
[https]
port=8043
username=httpsuser
[FTP]
port=8043
username=ftpuser
[database]
driverclass   = com.mysql.jdbc.Driver
dbName        = mydatabase
port          = 3306
username      = root
password      = 

INI file cheatsheet

Comment syntax starts with semicoolon ; followed by comments text Section or header are declared new line with square brackets[] followed by key and values options can be declared with same key and multiple values Each line of element contains key and values

values of any type, String,number,boolean,enum,array or map

; comment declared
; sections defined with multiple value
[Section-name]
key=value

; sections defined with multiple value
option1=true # in-line comments 
option1=false

; different values data

number1=123
number1_hexa=0x123
number1_octa=0123
number1_binary=0b1111
float_number1=123.12

;boolean values
value1=true
value2=false
  • key is valid identifier which will not contains = or ; symbols.
  • The value is valid identifier of any string
  • Key can be String, number or boolean values.