use of org.graalvm.component.installer.remote.MergeStorage in project graal by oracle.
the class GraalChannel method loadStorage.
@Override
protected ComponentStorage loadStorage() throws IOException {
FileDownloader dn = new FileDownloader(fb.l10n("OLDS_ReleaseFile"), getIndexURL(), fb);
dn.download();
Path storagePath = dn.getLocalFile().toPath();
List<ReleaseEntry> releases = loadReleasesIndex(storagePath);
if (releases.isEmpty()) {
return throwEmptyStorage();
}
MergeStorage store = new MergeStorage(localRegistry, fb);
store.setAcceptAllSources(true);
for (ReleaseEntry en : releases) {
URL catURL = en.getCatalogURL();
Version v = Version.fromString(en.getVersion().displayString());
SoftwareChannelSource src = new SoftwareChannelSource(catURL.toString(), en.getLabel());
WebCatalog cata = new WebCatalog(src.getLocationURL(), src) {
@Override
protected RemotePropertiesStorage createPropertiesStorage(Feedback aFeedback, ComponentRegistry aLocal, Properties props, String selector, URL baseURL) {
return new RemotePropertiesStorage(aFeedback, aLocal, props, selector, v, baseURL);
}
};
cata.init(localRegistry, fb);
cata.setMatchVersion(en.getVersion().match(Version.Match.Type.EXACT));
cata.setRemoteProcessor((i) -> configureLicense(i, en));
store.addChannel(src, cata);
}
return store;
}
Aggregations