@user96222 ,
It is very easy to setup the configuration from code. You need to name your configuration as either of the below formats.
1) fully qualified class path+"-yourname".xml. Example: com.adobe.acs.commons.replication.dispatcher.impl.DispatcherFlushRulesImpl-MyCustomName.xml. (this is not compatible with AEM as CS).
2) fully qualified class path+"~yourCustomName.cfg.json" . Example: com.adobe.granite.cors.impl.CORSPolicyImpl~YourCustomName.cfg.json. (this format is compatible with AEM as CS).
Place these file in the correct config folder based on the runmode you are trying to use in. Mostly, these files should be created in
"ui.config/src/main/content/jcr_root/apps/yourproject/osgiconfig/config"
"ui.config/src/main/content/jcr_root/apps/yourproject/osgiconfig/config.author"
"ui.config/src/main/content/jcr_root/apps/yourproject/osgiconfig/config.publish"