Skip to content

spiti-dev/config-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Config Reader - Simple way to read configuration files

Contents

Key Features

  • Reads .properties and .yml files
  • Returns configs as a Map<String, String>
  • Merges environment and project configs

Environments

  • Default config file name is project (project.properties OR project.yml)
  • Environment names can be any String value

Limitations

  • Empty config files are not handled.

Examples

Read YML files

Map<String, String> properties = new YmlConfig("dev").getConfig();
  • Reads dev.yml and project.yml
  • Merges both files - environment property is considered to return when duplicate key exists
  • Returns the merged configuration as a Map<String, String>
Map<String, String> properties = new YmlConfig().getConfig();
  • Reads and returns project.yml

Read PROPERTIES files

Map<String, String> properties = new PropertyConfig("dev").getConfig();
  • Reads dev.properties and project.properties
  • Merges both files - environment property is considered to return when duplicate key exists
  • Returns the merged configuration as a Map<String, String>
Map<String, String> properties = new PropertyConfig().getConfig();
  • Reads and returns project.properties

About

A way to read properties and yml files in similar fashion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages