Package io.quarkus.registry.config
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.quarkusdir, or the project dir) or in at the location specified by the caller. Also includes methods to parse the registry client configuration file.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_FILE_PATH_PROPERTYstatic StringCONFIG_RELATIVE_PATH
-
Constructor Summary
Constructors Constructor Description RegistriesConfigLocator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RegistryConfiggetDefaultRegistry()Returns the default registry client configuration which should be used in case no configuration file was found in the user's environment.static RegistriesConfigload(InputStream configYaml)Deserializes registry client configuration from an input stream.static RegistriesConfigload(Reader configYaml)Deserializes registry client configuration from a reader.static RegistriesConfigload(Path configYaml)Deserializes a given configuration file.static PathlocateConfigYaml()Returns the registry client configuration file or null, if the file could not be found.static PathlocateConfigYaml(Path configYaml)Returns the registry client configuration file or null if the file could not be found.static RegistriesConfigresolveConfig()Locate the registry client configuration file and deserialize it.
-
-
-
Field Detail
-
CONFIG_RELATIVE_PATH
public static final String CONFIG_RELATIVE_PATH
- See Also:
- Constant Field Values
-
CONFIG_FILE_PATH_PROPERTY
public static final String CONFIG_FILE_PATH_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
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:- if
quarkus.config.rootsystem property is set, its value will be used as the location of the configuration file - current user directory (which usually would be the project dir)
.quarkus/config.yamlin the user home directory
- Returns:
- registry client configuration, never null
- if
-
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
-
-