All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.cli.utils.Registries Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.cli.utils;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import io.quarkus.cli.registry.RegistryClientMixin;
import io.quarkus.registry.RegistryResolutionException;
import io.quarkus.registry.config.RegistryConfig;

public final class Registries {

    private Registries() {
        //Utility class
    }

    public static Set getRegistries(RegistryClientMixin client, String... additionalRegistires) {
        Set registries = new LinkedHashSet<>();
        try {
            for (RegistryConfig c : client.resolveConfig().getRegistries()) {
                registries.add(c.getId());
            }
            for (String r : additionalRegistires) {
                registries.add(r);
            }
            return registries;
        } catch (RegistryResolutionException e) {
            return new HashSet<>();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy