this.db = db;
this.index = index;
}
void backup(String key, Writer writer) {
QualityProfileDto profile;
DbSession dbSession = db.openSession(false);
try {
profile = db.qualityProfileDao().getNonNullByKey(dbSession, key);
} finally {
dbSession.close();
}
List<ActiveRule> activeRules = index.get(ActiveRuleIndex.class).findByProfile(profile.getKey());
writeXml(writer, profile, activeRules);
}