Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lserveriiev/configuration
Parsing and using configuration in java
https://github.com/lserveriiev/configuration
configuration java properties
Last synced: about 1 month ago
JSON representation
Parsing and using configuration in java
- Host: GitHub
- URL: https://github.com/lserveriiev/configuration
- Owner: lserveriiev
- License: mit
- Created: 2020-05-22T05:59:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T22:12:09.000Z (over 4 years ago)
- Last Synced: 2024-11-09T12:18:01.222Z (3 months ago)
- Topics: configuration, java, properties
- Language: Java
- Size: 20.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Configuration parser and reader
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](MIT)
[![Build Status](https://travis-ci.com/serveriev/configuration.svg?branch=master)](https://travis-ci.com/serveriev/configuration)> Parse and read configurations in java. This package covers only parsing the configuration properties files
> and resolving the environment variables in these files.## Install
This package didn't upload to the maven central repository. Thus, for using this dependency you can use [Jitpack.io](https://jitpack.io/).
### 1. Add the Jitpack repository to pom.xml
```sh
jitpack.io
https://jitpack.io
```
### 2. Add the di dependency to pom.xml
```sh
com.github.serveriev
configuration
v1.0```
## How to use
### 1. Add a configuration file to the resource folder.
### 2. Load and read configuration.
```java
import io.lenur.configuration.Configuration;public class Application {
public static void main(String[] args) {
Configuration configuration = new Configuration("application.properties");
System.out.println(configuration.get("database.username"));
System.out.println(configuration.get("database.url"));
String[] tech = configuration.getAsStringArray("technology.stack");//returns an array splitted by regex. default delimiter is |
String[] tech1 = configuration.getAsStringArray("technology.stack.regex", ",");//pass own delimiter
}
}
```## Issues
✅ Parsing property files
❌ Parsing yaml files
❌ Parsing xml file
✅ Resolving environment variables
❌ Resolving system variables
## Author
**Lenur**
* Github: [@serveriev](https://github.com/serveriev)
## License
Copyright © 2020 [Lenur](https://github.com/serveriev).
This project is [MIT](MIT) licensed.