Class RegistriesConfigLocator

java.lang.Object
io.quarkus.registry.config.RegistriesConfigLocator

public class RegistriesConfigLocator extends Object
A helper class set utility methods to locate the registry client configuration file in the default locations (e.g. user home .quarkus dir, or the project dir) or in at the location specified by the caller. Also includes methods to parse the registry client configuration file.
  • Field Details

  • Constructor Details

    • RegistriesConfigLocator

      public RegistriesConfigLocator()
  • Method Details

    • resolveConfig

      public static RegistriesConfig resolveConfig()
      Locate the registry client configuration file and deserialize it. The method will look for the file in the following locations in this order:
      1. if quarkus.config.root system property is set, its value will be used as the location of the configuration file
      2. current user directory (which usually would be the project dir)
      3. .quarkus/config.yaml in the user home directory
      If the configuration file can't be located (it is optional), an empty configuration will be returned to the caller.
      Returns:
      registry client configuration, never null
    • load

      public static RegistriesConfig load(Path configYaml)
      Deserializes a given configuration file.
      Parameters:
      configYaml - configuration file
      Returns:
      deserialized registry client configuration
    • load

      public static RegistriesConfig load(InputStream configYaml)
      Deserializes registry client configuration from an input stream.
      Parameters:
      configYaml - input stream
      Returns:
      deserialized registry client configuration
    • load

      public static RegistriesConfig load(Reader configYaml)
      Deserializes registry client configuration from a reader.
      Parameters:
      configYaml - reader
      Returns:
      deserialized registry client configuration
    • locateConfigYaml

      public static Path locateConfigYaml()
      Returns the registry client configuration file or null, if the file could not be found.
      Returns:
      the registry client configuration file or null, if the file could not be found
    • locateConfigYaml

      public static Path locateConfigYaml(Path configYaml)
      Returns the registry client configuration file or null if the file could not be found.
      Parameters:
      configYaml - Path to a pre-specified config file (e.g. a command line argument)
      Returns:
      the registry client configuration file or null if the file could not be found.
    • getDefaultRegistry

      public static RegistryConfig getDefaultRegistry()
      Returns the default registry client configuration which should be used in case no configuration file was found in the user's environment.
      Returns:
      default registry client configuration