Package org.sonar.wsclient.services

Examples of org.sonar.wsclient.services.RuleQuery


    public Rule getRule(UserCredentials userCredentials, String ruleKey) {
        try{
            return new RuleSearchClient(serverUrl).getRule(userCredentials, ruleKey);
        }catch(HttpException ex){
            if(ex.getMessage().contains("Error 404")){
                RuleQuery ruleQuery=new RuleQuery("java");
                String[] tokens=ruleKey.split(":");
                ruleQuery.setSearchText(tokens.length == 2? tokens[1]: ruleKey);
                Sonar sonar;
                if(userCredentials == null) {
                    sonar=Sonar.create(serverUrl);
                }else {
                    sonar=Sonar.create(serverUrl, userCredentials.getUsername(), PassEncoder.decodeAsString(userCredentials.getPassword()));
View Full Code Here


    @Override
    protected List<Rule> doInBackground() throws Exception {
        SonarProjectComponent component = project.getComponent(SonarProjectComponent.class);
        Sonar sonar = component.getSonar();
        return sonar.findAll(new RuleQuery("java"));
    }
View Full Code Here

TOP

Related Classes of org.sonar.wsclient.services.RuleQuery

Copyright © 2018 www.massapicom. 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.