Search in sources :

Example 1 with QProfileResult

use of org.sonar.server.qualityprofile.QProfileResult in project sonarqube by SonarSource.

the class CreateAction method doHandle.

private CreateWsResponse doHandle(DbSession dbSession, CreateRequest createRequest, Request request) {
    QProfileResult result = new QProfileResult();
    QualityProfileDto profile = profileFactory.create(dbSession, QProfileName.createFor(createRequest.getLanguage(), createRequest.getProfileName()));
    result.setProfile(profile);
    for (ProfileImporter importer : importers) {
        String importerKey = importer.getKey();
        InputStream contentToImport = request.paramAsInputStream(getBackupParamName(importerKey));
        if (contentToImport != null) {
            result.add(exporters.importXml(profile, importerKey, contentToImport, dbSession));
        }
    }
    dbSession.commit();
    activeRuleIndexer.index(result.getChanges());
    return buildResponse(result);
}
Also used : InputStream(java.io.InputStream) ProfileImporter(org.sonar.api.profiles.ProfileImporter) QProfileResult(org.sonar.server.qualityprofile.QProfileResult) QualityProfileDto(org.sonar.db.qualityprofile.QualityProfileDto)

Aggregations

InputStream (java.io.InputStream)1 ProfileImporter (org.sonar.api.profiles.ProfileImporter)1 QualityProfileDto (org.sonar.db.qualityprofile.QualityProfileDto)1 QProfileResult (org.sonar.server.qualityprofile.QProfileResult)1