1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package org.xwiki.repository.internal.resources; |
22 |
|
|
23 |
|
import javax.inject.Named; |
24 |
|
import javax.inject.Singleton; |
25 |
|
import javax.ws.rs.GET; |
26 |
|
import javax.ws.rs.Path; |
27 |
|
import javax.ws.rs.PathParam; |
28 |
|
|
29 |
|
import org.xwiki.component.annotation.Component; |
30 |
|
import org.xwiki.extension.repository.xwiki.model.jaxb.ExtensionVersion; |
31 |
|
import org.xwiki.query.QueryException; |
32 |
|
import org.xwiki.repository.Resources; |
33 |
|
|
34 |
|
import com.xpn.xwiki.XWikiException; |
35 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
36 |
|
|
37 |
|
|
38 |
|
@version |
39 |
|
@since |
40 |
|
|
41 |
|
@Component |
42 |
|
@Named("org.xwiki.repository.internal.resources.ExtensionVersionRESTResource") |
43 |
|
@Path(Resources.EXTENSION_VERSION) |
44 |
|
@Singleton |
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.33 |
|
45 |
|
public class ExtensionVersionRESTResource extends AbstractExtensionRESTResource |
46 |
|
{ |
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
47 |
70 |
@GET... |
48 |
|
public ExtensionVersion getExtensionVersion(@PathParam("extensionId") String extensionId, |
49 |
|
@PathParam("extensionVersion") String extensionVersion) throws XWikiException, QueryException |
50 |
|
{ |
51 |
70 |
XWikiDocument extensionDocument = getExistingExtensionDocumentById(extensionId); |
52 |
|
|
53 |
62 |
checkRights(extensionDocument); |
54 |
|
|
55 |
62 |
return createExtension(extensionDocument, extensionVersion); |
56 |
|
} |
57 |
|
} |