{"id":46645756,"url":"https://github.com/vincentrussell/java-ini-parser","last_synced_at":"2026-03-08T04:33:52.522Z","repository":{"id":57723898,"uuid":"397317713","full_name":"vincentrussell/java-ini-parser","owner":"vincentrussell","description":"The java-ini-parser is a java utility for parsing ini files.","archived":false,"fork":false,"pushed_at":"2024-10-05T13:45:53.000Z","size":62,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T17:38:56.150Z","etag":null,"topics":["ini","java","parser"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vincentrussell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-08-17T16:09:25.000Z","updated_at":"2025-07-22T12:57:24.000Z","dependencies_parsed_at":"2023-10-15T21:13:52.440Z","dependency_job_id":"390ee67f-d54f-4c20-9e6a-9f988f1d5788","html_url":"https://github.com/vincentrussell/java-ini-parser","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/vincentrussell/java-ini-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentrussell%2Fjava-ini-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentrussell%2Fjava-ini-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentrussell%2Fjava-ini-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentrussell%2Fjava-ini-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vincentrussell","download_url":"https://codeload.github.com/vincentrussell/java-ini-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vincentrussell%2Fjava-ini-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30245268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ini","java","parser"],"created_at":"2026-03-08T04:33:52.376Z","updated_at":"2026-03-08T04:33:52.494Z","avatar_url":"https://github.com/vincentrussell.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# java-ini-parser [![Maven Central](https://img.shields.io/maven-central/v/com.github.vincentrussell/java-ini-parser.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.vincentrussell%22%20AND%20a:%22java-ini-parser%22) [![Build Status](https://travis-ci.org/vincentrussell/java-ini-parser.svg?branch=master)](https://travis-ci.org/vincentrussell/java-ini-parser)\n\njava-ini-parser helps you parse ini files in java.   \n\n## Maven\n\nAdd a dependency to `com.github.vincentrussell:java-ini-parser`. \n\n```\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.github.vincentrussell\u003c/groupId\u003e\n   \u003cartifactId\u003ejava-ini-parser\u003c/artifactId\u003e\n   \u003cversion\u003e1.7\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Requirements\n- JDK 1.8 or higher\n\n## Running it from Java\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\");\n```\n\n## Available options\n\n### Get the sections\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Collection\u003cString\u003e sections = ini.getSections();\n```\n\n### Get the keys\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Collection\u003cString\u003e keys = ini.getKeys(\"FTPS\")\n```\n\n### Get a value\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Object value = ini.getValue(\"String\", \"string\")\n```\n\n### Has a key\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n boolean has = ini.hasKey(\"String\", \"string\")\n```\n\n\n### Get a section as Map\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Map\u003cString, Object\u003e value = ini.getSection(\"FTP\")\n```\n\n### Cast a number to a particular type\n\nBe careful!  Precision can be lost here.\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n int value = ini.getValue(\"Numbers\", \"long\", int.class)\n```\n\n### Put a value\n\n```\n Ini ini = new Ini();\n ini.putValue(\"section\", \"key\", \"value\")\n```\n\n### Put multiple key/value pairs into a section\n\n```\n Ini ini = new Ini();\n Ini ini2 = new Ini();\n ini2.putValue(\"Char\", \"charKey\", \"b\");\n ini2.putValue(\"Char\", \"characterKey\", \"z\");\n ini2.putValue(\"String\", \"string\", \"Hello\");\n ini.putValues(\"Char\", ini2.getSection(\"Char\"));\n```\n\n### Merge two ini files\n\n```\n Ini ini = new Ini();\n Ini ini2 = new Ini();\n ini2.putValue(\"String\", \"user2\", \"Henry2\");\n ini.merge(ini2);\n```\n\n\n\n### Write ini to file\n\n```\n Ini ini = new Ini();\n ini.putValue(\"section\", \"key\", \"value\")\n ini.store(new FileWriter(\"/tmp/file.ini\"), \"some comments at the top of the file\");\n```\n\n### remove key from a section\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Object value = ini.removeSectionKey(\"String\", \"string\")\n```\n### remove a section\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Object value = ini.removeSection(\"String\")\n```\n\n### get section entries that have keys that start with prefix\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Map\u003cString, Object\u003e result = ini.getSectionWithKeysWithPrefix(\"Sample\", \"my.port.\");\n```\n### get section entries that have keys that match a regex\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Map\u003cString, Object\u003e result = ini.getSectionWithKeysWithRegex(\"Sample\", \"^my\\\\.port\\\\.[\\\\d]{1}\");\n```\n\n### get section entries that have keys that matches a filter\n\n```\n Ini ini = new Ini();\n ini.load(new FileInputStream(\"samples/sample2.ini\"));\n Map\u003cString, Object\u003e result = ini.getSectionWithKeysThatMatchFunction(\"Sample\", entry -\u003e Double.class.isInstance(entry.getValue()));\n```\n\n### multiline support\n\n```\n[group]\nkey=value\nmultilineKey = \\\n    this \\\n    is \\\n    a \\\n    multi-line \\\n    value\nanotherKey = value\n```\n\n### string interpolation support from variables defined in ini section, system properties or environment variables\n\n```\n[section]\nvariable=some value\nsysProperty=wouldn't you like to know that ${some.sys.property}\nvarKey=value is ${variable}\nenvVarKey=value is ${ENV_VAR1}\n```\n\n# Change Log\n\n## [1.7](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.7) (2024-10-05)\n\n**Enhancements:**\n\n- N/A\n\n**Bugs:**\n\n- Fixed null pointer exception when using getValue with casting\n\n## [1.6](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.6) (2023-10-28)\n\n**Enhancements:**\n\n- added the ability to merge two Ini files\n- added the ability to put an entire map into an ini section (merge section)\n\n**Bugs:**\n\n- Fixed issues with writing out multiline comments\n\n\n## [1.5](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.5) (2023-03-10)\n\n**Enhancements:**\n\n- added hasKey function\n\n**Bugs:**\n\n- Booleans not handled properly when calling ini.getValue(\"Boolean\", \"key\", Boolean.class)\n- Characters not handled properly when calling ini.getValue(\"Char\", \"charKey\", char.class)\n\n## [1.4](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.4) (2022-12-29)\n\n**Enhancements:**\n\n- Internal ini structure is now backed by LinkedHashMap instead of Hashmap to maintain insert order\n- created Map\u003cString, Object\u003e getSectionWithKeysThatMatchFunction(String section, Predicate\u003cMap.Entry\u003cString, Object\u003e\u003e filter) method\n- multiline support with ending lines with '\\\\'\n- string interpolation support\n\n**Bugs:**\n\n- Escaped semicolons and pound signs not working properly\n\n## [1.3](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.3) (2022-08-21)\n\n**Enhancements:**\n\n- Support for inline comments with ; and #\n- Support for special characters that can be found in ini files like \\b,\\f,\\r\\t,etc\n\n## [1.2](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.2) (2022-07-20)\n\n**Enhancements:**\n\n- Upgraded commons-io\n\n## [1.1](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.1) (2021-09-06)\n\n**Enhancements:**\n\n- Created getSectionWithKeysWithPrefix and getSectionWithKeysWithRegex\n- Added the ability to remove sections and remove values from ini.\n\n## [1.0](https://github.com/vincentrussell/java-ini-parser/tree/java-ini-parser-1.0) (2021-08-20)\n\n**Bugs:**\n\n- N/A\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentrussell%2Fjava-ini-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvincentrussell%2Fjava-ini-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvincentrussell%2Fjava-ini-parser/lists"}