use of org.graalvm.component.installer.ce.WebCatalog 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;
}
use of org.graalvm.component.installer.ce.WebCatalog in project graal by oracle.
the class TestCatalog method createChannel.
@Override
public SoftwareChannel createChannel(SoftwareChannelSource spec, CommandInput input, Feedback fb) {
if (spec.getLocationURL().startsWith("test://")) {
WebCatalog c = new WebCatalog(spec.getLocationURL(), spec);
c.init(input, fb);
return c;
}
return null;
}
Aggregations