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 |
|
import org.xwiki.extension.repository.ExtensionRepositoryManager; |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
@version |
42 |
|
@since |
43 |
|
|
44 |
|
@Component |
45 |
|
@Singleton |
46 |
|
@Named("default.xwiki") |
|
|
| 54.5% |
Uncovered Elements: 5 (11) |
Complexity: 4 |
Complexity Density: 0.57 |
|
47 |
|
public class ExtensionXWikiOrgExtensionRepositorySource extends AbstractExtensionRepositorySource |
48 |
|
{ |
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
public static final int PRIORITY = ExtensionRepositoryManager.DEFAULT_PRIORITY + 200; |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
@Inject |
60 |
|
private ExtensionManagerConfiguration configuration; |
61 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
62 |
0 |
@Override... |
63 |
|
public int getPriority() |
64 |
|
{ |
65 |
0 |
return PRIORITY; |
66 |
|
} |
67 |
|
|
|
|
| 62.5% |
Uncovered Elements: 3 (8) |
Complexity: 3 |
Complexity Density: 0.5 |
|
68 |
1 |
@Override... |
69 |
|
public Collection<ExtensionRepositoryDescriptor> getExtensionRepositoryDescriptors() |
70 |
|
{ |
71 |
1 |
Collection<ExtensionRepositoryDescriptor> configuredRepositories = |
72 |
|
this.configuration.getExtensionRepositoryDescriptors(); |
73 |
|
|
74 |
1 |
Collection<ExtensionRepositoryDescriptor> repositories = new ArrayList<ExtensionRepositoryDescriptor>(); |
75 |
|
|
76 |
1 |
if (configuredRepositories == null) { |
77 |
0 |
try { |
78 |
0 |
repositories.add(new DefaultExtensionRepositoryDescriptor("extensions.xwiki.org", "xwiki", |
79 |
|
new URI("http://extensions.xwiki.org/xwiki/rest/"))); |
80 |
|
} catch (URISyntaxException e) { |
81 |
|
|
82 |
|
} |
83 |
|
} |
84 |
|
|
85 |
1 |
return repositories; |
86 |
|
} |
87 |
|
} |