Clover Coverage Report - XWiki Commons - Parent POM 4.0-SNAPSHOT (Aggregated)
Coverage timestamp: Mon Mar 12 2012 17:13:48 CET
../../../../../../img/srcFileCovDistChart0.png 69% of files have more coverage
4   66   3   4
2   32   0.75   1
1     3  
1    
 
  XWikiExtensionRepositorySource       Line # 45 4 0% 3 7 0% 0.0
 
No Tests
 
1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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    * Extensions repositories identifier stored in the configuration.
39    *
40    * @version $Id: 0cd33af3ea309c8c3bc12c93b9cc7e11bf8e9d30 $
41    */
42    @Component
43    @Singleton
44    @Named("default.xwiki")
 
45    public class XWikiExtensionRepositorySource implements ExtensionRepositorySource
46    {
47    /**
48    * Used to get configuration properties containing repositories.
49    */
50    @Inject
51    private ExtensionManagerConfiguration configuration;
52   
 
53  0 toggle @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    // Should never happen
63  0 return Collections.emptyList();
64    }
65    }
66    }