aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileBackuper.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileBackupAction.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileExportAction.java7
4 files changed, 10 insertions, 5 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java
index d3fdaff68bb..3f15d12f4d5 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerComponents.java
@@ -268,6 +268,8 @@ import org.sonar.server.qualityprofile.ws.QProfileCompareAction;
import org.sonar.server.qualityprofile.ws.QProfileCopyAction;
import org.sonar.server.qualityprofile.ws.QProfileCreateAction;
import org.sonar.server.qualityprofile.ws.QProfileDeleteAction;
+import org.sonar.server.qualityprofile.ws.QProfileExportAction;
+import org.sonar.server.qualityprofile.ws.QProfileExportersAction;
import org.sonar.server.qualityprofile.ws.QProfileImportersAction;
import org.sonar.server.qualityprofile.ws.QProfileInheritanceAction;
import org.sonar.server.qualityprofile.ws.QProfileProjectsAction;
@@ -377,6 +379,7 @@ import org.sonar.server.ws.ListingWs;
import org.sonar.server.ws.WebServiceEngine;
import javax.annotation.Nullable;
+
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileBackuper.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileBackuper.java
index a5a2146e9e3..87e0ab6929a 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileBackuper.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/QProfileBackuper.java
@@ -50,8 +50,6 @@ import java.util.Set;
public class QProfileBackuper implements ServerComponent {
- public static final String MEDIA_TYPE_XML = "text/xml";
-
private final QProfileReset reset;
private final DbClient db;
private final IndexClient index;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileBackupAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileBackupAction.java
index 0c0aadf68cc..aa347835a48 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileBackupAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileBackupAction.java
@@ -29,6 +29,7 @@ import org.sonar.api.server.ws.WebService;
import org.sonar.api.server.ws.WebService.NewAction;
import org.sonar.core.persistence.DbSession;
import org.sonar.server.db.DbClient;
+import org.sonar.server.plugins.MimeTypes;
import org.sonar.server.qualityprofile.QProfileBackuper;
import org.sonar.server.qualityprofile.QProfileFactory;
@@ -65,7 +66,7 @@ public class QProfileBackupAction implements BaseQProfileWsAction {
@Override
public void handle(Request request, Response response) throws Exception {
Stream stream = response.stream();
- stream.setMediaType(QProfileBackuper.MEDIA_TYPE_XML);
+ stream.setMediaType(MimeTypes.XML);
OutputStreamWriter writer = new OutputStreamWriter(stream.output(), Charsets.UTF_8);
DbSession session = dbClient.openSession(false);
try {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileExportAction.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileExportAction.java
index 2af41d993ee..5d357905b59 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileExportAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ws/QProfileExportAction.java
@@ -24,13 +24,16 @@ import org.apache.commons.io.IOUtils;
import org.sonar.api.profiles.ProfileExporter;
import org.sonar.api.resources.Language;
import org.sonar.api.resources.Languages;
-import org.sonar.api.server.ws.*;
+import org.sonar.api.server.ws.Request;
+import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.Response.Stream;
+import org.sonar.api.server.ws.WebService;
import org.sonar.api.server.ws.WebService.NewAction;
import org.sonar.core.persistence.DbSession;
import org.sonar.core.qualityprofile.db.QualityProfileDto;
import org.sonar.server.db.DbClient;
import org.sonar.server.exceptions.NotFoundException;
+import org.sonar.server.plugins.MimeTypes;
import org.sonar.server.qualityprofile.QProfileBackuper;
import org.sonar.server.qualityprofile.QProfileExporters;
import org.sonar.server.qualityprofile.QProfileFactory;
@@ -122,7 +125,7 @@ public class QProfileExportAction implements BaseQProfileWsAction {
String profileKey = profile.getKey();
if (format == null) {
- stream.setMediaType(QProfileBackuper.MEDIA_TYPE_XML);
+ stream.setMediaType(MimeTypes.XML);
backuper.backup(profileKey, writer);
} else {
stream.setMediaType(exporters.mimeType(format));