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.Arrays; |
25 |
|
import java.util.Collections; |
26 |
|
import java.util.List; |
27 |
|
|
28 |
|
import javax.inject.Inject; |
29 |
|
import javax.inject.Named; |
30 |
|
import javax.inject.Singleton; |
31 |
|
|
32 |
|
import org.xwiki.component.annotation.Component; |
33 |
|
import org.xwiki.extension.ExtensionManagerConfiguration; |
34 |
|
import org.xwiki.extension.repository.ExtensionRepositoryId; |
35 |
|
import org.xwiki.extension.repository.ExtensionRepositorySource; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@version |
41 |
|
|
42 |
|
@Component |
43 |
|
@Singleton |
44 |
|
@Named("default.xwiki") |
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.75 |
|
45 |
|
public class XWikiExtensionRepositorySource implements ExtensionRepositorySource |
46 |
|
{ |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
@Inject |
51 |
|
private ExtensionManagerConfiguration configuration; |
52 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 3 |
Complexity Density: 0.75 |
|
53 |
0
|
@Override... |
54 |
|
public List<ExtensionRepositoryId> getExtensionRepositories() |
55 |
|
{ |
56 |
0
|
List<ExtensionRepositoryId> repositories = this.configuration.getRepositories(); |
57 |
|
|
58 |
0
|
try { |
59 |
0
|
return repositories != null ? repositories : Arrays.asList(new ExtensionRepositoryId( |
60 |
|
"extensions.xwiki.org", "xwiki", new URI("http://extensions.xwiki.org/xwiki/rest/"))); |
61 |
|
} catch (URISyntaxException e) { |
62 |
|
|
63 |
0
|
return Collections.emptyList(); |
64 |
|
} |
65 |
|
} |
66 |
|
} |