*/
package org.sonar.server.component.ws;
-import com.google.common.io.Resources;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.ws.RemovedWebServiceHandler;
.setSince("2.10")
.setDeprecatedSince("5.4")
.setHandler(RemovedWebServiceHandler.INSTANCE)
- .setResponseExample(Resources.getResource(this.getClass(), "resources-example-index.json"));
+ .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
}
}
*/
package org.sonar.server.measure.ws;
-import com.google.common.io.Resources;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.ws.RemovedWebServiceHandler;
.setSince("2.10")
.setDeprecatedSince("6.3")
.setHandler(RemovedWebServiceHandler.INSTANCE)
- .setResponseExample(Resources.getResource(this.getClass(), "timemachine-example-index.json"));
+ .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
}
}
*/
package org.sonar.server.qualityprofile.ws;
-import com.google.common.io.Resources;
import org.sonar.api.server.ws.WebService;
import org.sonar.server.ws.RemovedWebServiceHandler;
.setSince("3.3")
.setDeprecatedSince("5.2")
.setHandler(RemovedWebServiceHandler.INSTANCE)
- .setResponseExample(Resources.getResource(ProfilesWs.class, "example-index.json"));
+ .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
}
private static void defineListAction(NewController controller) {
.setSince("3.3")
.setDeprecatedSince("5.2")
.setHandler(RemovedWebServiceHandler.INSTANCE)
- .setResponseExample(Resources.getResource(ProfilesWs.class, "example-list.json"));
+ .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
}
}
.setDescription("This web service is removed")
.setSince("2.6")
.setDeprecatedSince("6.3")
- .setResponseExample(getClass().getResource("user_properties-index-example.xml"))
- .setHandler(RemovedWebServiceHandler.INSTANCE);
+ .setHandler(RemovedWebServiceHandler.INSTANCE)
+ .setResponseExample(RemovedWebServiceHandler.INSTANCE.getResponseExample());
}
}
package org.sonar.server.ws;
+import com.google.common.io.Resources;
+import java.net.URL;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.RequestHandler;
import org.sonar.api.server.ws.Response;
public void handle(Request request, Response response) throws Exception {
throw new ServerException(HTTP_GONE, String.format("The web service '%s' doesn't exist anymore, please read its documentation to use alternatives", request.getPath()));
}
+
+ public URL getResponseExample() {
+ return Resources.getResource(RemovedWebServiceHandler.class, "removed-ws-example.json");
+ }
}
-[
- {
- "id": 2865,
- "key": "org.codehaus.sonar:sonar",
- "name": "Sonar",
- "scope": "PRJ",
- "qualifier": "TRK",
- "date": "2012-08-10T04:03:51+0200",
- "creationDate": "2012-08-10T04:03:51+0200",
- "lname": "Sonar",
-
- // Only available at file level
- "lang": "java",
-
- // Only available at project and module levels
- "version": "3.3-SNAPSHOT",
- "description": "Open source platform for continuous inspection of code quality",
-
- // Description of differential periods
- "p1": "previous_analysis",
- "p1p": "2012-08-09",
- "p1d": "2012-08-09T04:04:01+0200",
- "p2": "days",
- "p2p": "7",
- "p2d": "2012-08-03T04:03:51+0200",
-
- // Values for the selected metrics
- "msr": [
- {
- "key": "coverage",
- "val": 70.3,
- "frmt_val": "70.3%",
- "alert": null,
- "alert_text": null,
- "trend": 0,
- "var": 0,
- "var1": 0.0,
- "var2": 0.0
- }
- ]
- }
-]
+{
+ "errors": [
+ {
+ "msg": "The web service '/api/resources/index' doesn't exists anymore, please read its documentation to use alternatives"
+ }
+ ]
+}
+++ /dev/null
-{
- "total": 405,
- "page": 1,
- "page_size": 10,
- "data": [
- {
- "id": 21434,
- "key": "org.codehaus.mojo:sonar-maven-plugin:src/main/java/org/codehaus/mojo/sonar/SonarMojo.java",
- "nm": "src/main/java/org/codehaus/mojo/sonar/SonarMojo.java",
- "q": "FIL"
- },
- {
- "id": 4138,
- "key": "org.codehaus.sonar:sonar-ws-client:src/main/java/org/sonar/wsclient/Sonar.java",
- "nm": "src/main/java/org/sonar/wsclient/Sonar.java",
- "q": "FIL"
- },
- {
- "id": 3868,
- "key": "org.codehaus.sonar:sonar-server:src/main/java/org/sonar/server/platform/SonarHome.java",
- "nm": "src/main/java/org/sonar/server/platform/SonarHome.java",
- "q": "FIL"
- }
- ]
-}
+++ /dev/null
-[
- {
- "cols": [
- {
- "metric": "complexity"
- },
- {
- "metric": "lines"
- }
- ],
- "cells": [
- {
- "d": "2011-10-02T00:01:00+0200",
- "v": [
- 11879,
- 94500
- ]
- },
- {
- "d": "2011-10-25T12:27:41+0200",
- "v": [
- 13528,
- 102508
- ]
- }
- ]
- }
-]
+++ /dev/null
-[
- {
- "name": "Sonar way",
- "language": "java",
- "default": true,
- "rules": [
- {
- "key": "DuplicatedBlocks",
- "repo": "common-java",
- "severity": "MAJOR"
- },
- {
- "key": "InsufficientBranchCoverage",
- "repo": "common-java",
- "severity": "MAJOR",
- "params": [
- {
- "key": "minimumBranchCoverageRatio",
- "value": "65.0"
- }
- ]
- },
- {
- "key": "S00105",
- "repo": "squid",
- "severity": "MINOR"
- },
- {
- "key": "MethodCyclomaticComplexity",
- "repo": "squid",
- "severity": "MAJOR",
- "params": [
- {
- "key": "max",
- "value": "10"
- }
- ]
- }
- ]
- }
-]
+++ /dev/null
-[
- {
- "name": "Sonar way with Findbugs",
- "language": "java",
- "default": false
- },
- {
- "name": "Sonar way",
- "language": "java",
- "default": false
- }
-]
+++ /dev/null
-<properties>
- <property>
- <key>favourite</key>
- <value><![CDATA[]]></value>
- </property>
- <property>
- <key>favourite</key>
- <value><![CDATA[]]></value>
- </property>
- <property>
- <key>notification.ChangesOnMyIssue.EmailNotificationChannel</key>
- <value><![CDATA[true]]></value>
- </property>
- <property>
- <key>notification.SQ-MyNewIssues.EmailNotificationChannel</key>
- <value><![CDATA[true]]></value>
- </property>
- <property>
- <key>notification.ChangesOnMyIssue.EmailNotificationChannel</key>
- <value><![CDATA[true]]></value>
- </property>
- <property>
- <key>notification.SQ-MyNewIssues.EmailNotificationChannel</key>
- <value><![CDATA[true]]></value>
- </property>
- <property>
- <key>notification.NewIssues.EmailNotificationChannel</key>
- <value><![CDATA[true]]></value>
- </property>
-</properties>
--- /dev/null
+{
+ "errors": [
+ {
+ "msg": "The web service '/api/...' doesn't exists anymore, please read its documentation to use alternatives"
+ }
+ ]
+}