@Override public ExtensionRepositoryId getId() { return new ExtensionRepositoryId(this.descriptor); }
private ExtensionRepositoryId parseRepository(String repositoryString) throws URISyntaxException { Matcher matcher = REPOSITORYIDPATTERN.matcher(repositoryString); if (matcher.matches()) { new ExtensionRepositoryId(matcher.group(1), matcher.group(2), new URI(matcher.group(3))); } // TODO: throw exception return null; } }
/** * @param id the repository identifier * @deprecated since 4.3M1 use {@link #AbstractExtensionRepository(ExtensionRepositoryDescriptor)} instead */ @Deprecated protected AbstractExtensionRepository(ExtensionRepositoryId id) { setId(new ExtensionRepositoryId(id)); }
@Override public Collection<ExtensionRepositoryId> getExtensionRepositories() { Collection<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>(); for (ExtensionRepositoryDescriptor descriptor : getExtensionRepositoryDescriptors()) { repositories.add(new ExtensionRepositoryId(descriptor)); } return repositories; } }
/** * {@inheritDoc} * * @see org.xwiki.component.phase.Initializable#initialize() */ public void initialize() throws InitializationException { this.repositoryId = new ExtensionRepositoryId("core", "xwiki-core", null); loadExtensions(); }
@Override public Collection<ExtensionRepositoryId> getRepositories() { Collection<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>(); for (ExtensionRepositoryDescriptor descriptor : getExtensionRepositoryDescriptors()) { repositories.add(new ExtensionRepositoryId(descriptor)); } return repositories; }
public List<ExtensionRepositoryId> getRepositories() { List<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>(); List<String> repositoryStrings = this.configurationSource.getProperty("extension.repositories", Collections.<String> emptyList()); if (repositoryStrings != null && !repositoryStrings.isEmpty()) { for (String repositoryString : repositoryStrings) { try { ExtensionRepositoryId extensionRepositoryId = parseRepository(repositoryString); repositories.add(extensionRepositoryId); } catch (Exception e) { getLogger().warn("Faild to parse repository [" + repositoryString + "] from configuration", e); } } } else { try { repositories.add(new ExtensionRepositoryId("xwiki-releases", "maven", new URI( "http://maven.xwiki.org/releases/"))); repositories.add(new ExtensionRepositoryId("central", "maven", new URI("http://repo1.maven.org/maven2/"))); } catch (Exception e) { // Should never happen } } return repositories; }
public void initialize() throws InitializationException { this.rootFolder = this.configuration.getLocalRepository(); this.repositoryId = new ExtensionRepositoryId("local", "xwiki", this.rootFolder.toURI()); this.extensionSerializer = new DefaultLocalExtensionSerializer(this); loadExtensions(); }