Skip to content

Instantly share code, notes, and snippets.

View arana3's full-sized avatar

Ahmad R arana3

  • Accenture
View GitHub Profile
@michalmela
michalmela / TypesafeConfigPropertySourceFactory.java
Last active September 15, 2023 14:27
[hocon-spring] A set of examples of using HOCON / TypesafeConfig (the latter being the more important part, with the former being just one of the optional formats, but HOCON sounds so much better than the mouthful TypesafeConfig) outside of their typical use cases
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.PropertySourceFactory;
import java.io.IOException;
import java.util.Map;