Examples of HttpRequestFactory


Examples of org.sonar.wsclient.internal.HttpRequestFactory

    }
   
    public Rule getRule(UserCredentials userCredentials, String key) {
        Map<String, Object> params=new HashMap<>();
        params.put("key", key);
        HttpRequestFactory httpRequestFactory = new HttpRequestFactory(baseUrl);
        if(userCredentials != null) {
            httpRequestFactory.setLogin(userCredentials.getUsername()).setPassword(PassEncoder.decodeAsString(userCredentials.getPassword()));
        }
        String jsonRule = httpRequestFactory.get("/api/rules/show", params);
        try{
            JsonElement jsonElement = new JsonParser().parse(new StringReader(jsonRule));
            JsonObject rule = (JsonObject) ((JsonObject)jsonElement).get("rule");
            Rule rule1 = new Rule();
            rule1.setKey(rule.get("key").getAsString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.