1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.extension.repository.xwiki.internal; |
21 |
|
|
22 |
|
import java.net.URI; |
23 |
|
import java.net.URISyntaxException; |
24 |
|
import java.util.ArrayList; |
25 |
|
import java.util.Collection; |
26 |
|
|
27 |
|
import javax.inject.Inject; |
28 |
|
import javax.inject.Named; |
29 |
|
import javax.inject.Singleton; |
30 |
|
|
31 |
|
import org.xwiki.component.annotation.Component; |
32 |
|
import org.xwiki.extension.ExtensionManagerConfiguration; |
33 |
|
import org.xwiki.extension.repository.AbstractExtensionRepositorySource; |
34 |
|
import org.xwiki.extension.repository.DefaultExtensionRepositoryDescriptor; |
35 |
|
import org.xwiki.extension.repository.ExtensionRepositoryDescriptor; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@version |
41 |
|
@since |
42 |
|
|
43 |
|
@Component |
44 |
|
@Singleton |
45 |
|
@Named("default.xwikisas.xwiki") |
|
|
| 54.5% |
Uncovered Elements: 5 (11) |
Complexity: 4 |
Complexity Density: 0.57 |
|
46 |
|
public class StoreXWikiComExtensionRepositorySource extends AbstractExtensionRepositorySource |
47 |
|
{ |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
@Inject |
52 |
|
private ExtensionManagerConfiguration configuration; |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
0 |
@Override... |
55 |
|
public int getPriority() |
56 |
|
{ |
57 |
0 |
return ExtensionXWikiOrgExtensionRepositorySource.PRIORITY - 10; |
58 |
|
} |
59 |
|
|
|
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
60 |
1 |
@Override... |
61 |
|
public Collection<ExtensionRepositoryDescriptor> getExtensionRepositoryDescriptors() |
62 |
|
{ |
63 |
1 |
Collection<ExtensionRepositoryDescriptor> configuredRepositories = |
64 |
|
this.configuration.getExtensionRepositoryDescriptors(); |
65 |
|
|
66 |
1 |
Collection<ExtensionRepositoryDescriptor> repositories = new ArrayList<>(); |
67 |
|
|
68 |
1 |
if (configuredRepositories == null) { |
69 |
0 |
try { |
70 |
0 |
repositories.add(new DefaultExtensionRepositoryDescriptor("store.xwiki.com", "xwiki", |
71 |
|
new URI("https://store.xwiki.com/xwiki/rest/"))); |
72 |
|
} catch (URISyntaxException e) { |
73 |
|
|
74 |
|
} |
75 |
|
} |
76 |
|
|
77 |
1 |
return repositories; |
78 |
|
} |
79 |
|
} |