Fetch properties from Sonarqube via Sonarqube wsClient -
i'd fetch sonar.timemachine.period1
via wsclient. seeing doesn't have one, decided bake 1 myself
private map<string, string> retrieveperiodproperties(final wsclient wsclient, int requestedperiod) { if (requestedperiod > 0) { final wsrequest propertieswsrequestperiod = new getrequest("api/properties/sonar.timemachine.period" + requestedperiod); final wsresponse propertieswsresponseperiod = wsclient.wsconnector().call(propertieswsrequestperiod); if (propertieswsresponseperiod.issuccessful()) { string resp = propertieswsresponseperiod.content(); map<string, string> map = new hashmap<>(); map.put(integer.tostring(requestedperiod), resp); return map; } } return new hashmap<>(); }
but return empty map<>
any lead can go direction?
you can use org.sonar.api.config.settings
fetch properties defined in sonarqube.
Comments
Post a Comment