use of org.apache.ivy.osgi.updatesite.xml.EclipseFeature in project ant-ivy by apache.
the class UpdateSiteLoader method loadFromSite.
private UpdateSiteDescriptor loadFromSite(UpdateSite site) throws IOException, SAXException {
UpdateSiteDescriptor repoDescriptor = new UpdateSiteDescriptor(site.getUri(), ExecutionEnvironmentProfileProvider.getInstance());
for (EclipseFeature feature : site.getFeatures()) {
URL url = site.getUri().resolve(feature.getUrl()).toURL();
final URLResource res = new URLResource(url, this.timeoutConstraint);
ArtifactDownloadReport report = repositoryCacheManager.downloadRepositoryResource(res, feature.getId(), "feature", "jar", options, urlRepository);
if (report.getDownloadStatus() == DownloadStatus.FAILED) {
return null;
}
try (InputStream in = new FileInputStream(report.getLocalFile())) {
ZipInputStream zipped = findEntry(in, "feature.xml");
if (zipped == null) {
return null;
}
EclipseFeature f = FeatureParser.parse(zipped);
f.setURL(feature.getUrl());
repoDescriptor.addFeature(f);
}
}
return repoDescriptor;
}
Aggregations