Package org.projectnessie.client.config
Class NessieClientConfigSources
java.lang.Object
org.projectnessie.client.config.NessieClientConfigSources
Provides functionality to retrieve configuration values from various sources, like Java
properties, maps and environment variables.
Note that the current implementation does not need any additional libraries. If there is a need for advanced features like config encryption or expressions, the implementation might start using SmallRye-Config.
-
Method Summary
Modifier and TypeMethodDescriptionstatic NessieClientConfigSourceCreates a configuration value retriever using reasonable default config sources.static NessieClientConfigSourceUses values from the~/.envfile.static NessieClientConfigSourcestatic NessieClientConfigSourceenvironmentConfigSource(Map<String, String> environment) Uses values from the given map, where keys in the file follow theenvironment name mapping.static NessieClientConfigSourceenvironmentFileConfigSource(Path envFile) Uses values from the given file, where keys in the file follow theenvironment name mapping.static NessieClientConfigSourcefromIcebergRestCatalogProperties(Map<String, String> catalogProperties) Produces a config source from the IcebergRESTCatalogproperties, mapping Nessie client configs to Iceberg REST catalog properties, requiring REST catalog properties as returned from Nessie Catalog.static NessieClientConfigSourcemapConfigSource(Map<String, String> properties) Uses values from the givenMap.static NessieClientConfigSourceUses values from the~/.config/nessie/nessie-client.propertiesfile.static NessieClientConfigSourcepropertiesConfigSource(Properties properties) Uses values from the givenProperties.static NessieClientConfigSourcepropertiesFileConfigSource(Path propertiesFile) Uses values from the given properties file.static StringpropertyNameToEnvironmentName(String propertyName) Converts a given property name to the "environment variable name syntax", using upper-case characters and converting.("dot") and-("minus") to_("underscore").static NessieClientConfigSourceUses values from the system environment, keys follow theenvironment name mapping.static NessieClientConfigSourceUses values from the Java system properties of the process.
-
Method Details
-
dotEnvFileConfigSource
Uses values from the~/.envfile.Similar to the behavior of smallrye-config, the
~/.envfile must be in the Java properties file format.- See Also:
-
nessieClientConfigFileConfigSource
Uses values from the~/.config/nessie/nessie-client.propertiesfile.- See Also:
-
systemEnvironmentConfigSource
Uses values from the system environment, keys follow theenvironment name mapping.- See Also:
-
systemPropertiesConfigSource
Uses values from the Java system properties of the process.- See Also:
-
environmentFileConfigSource
Uses values from the given file, where keys in the file follow theenvironment name mapping.Similar to the behavior of smallrye-config, the
.envfile must be in the Java properties file format.- See Also:
-
environmentConfigSource
Uses values from the given map, where keys in the file follow theenvironment name mapping.- See Also:
-
propertiesFileConfigSource
Uses values from the given properties file.- See Also:
-
propertiesConfigSource
Uses values from the givenProperties.- See Also:
-
mapConfigSource
Uses values from the givenMap.- See Also:
-
propertyNameToEnvironmentName
Converts a given property name to the "environment variable name syntax", using upper-case characters and converting.("dot") and-("minus") to_("underscore"). -
defaultConfigSources
Creates a configuration value retriever using reasonable default config sources.Config values are retrieved from the following sources:
- Java system properties, see
systemPropertiesConfigSource() - Process environment, see
systemEnvironmentConfigSource() ~/.config/nessie/nessie-client-propertiesfile, seenessieClientConfigFileConfigSource()~/.envfile, seedotEnvFileConfigSource()
- Java system properties, see
-
fromIcebergRestCatalogProperties
public static NessieClientConfigSource fromIcebergRestCatalogProperties(Map<String, String> catalogProperties) Produces a config source from the IcebergRESTCatalogproperties, mapping Nessie client configs to Iceberg REST catalog properties, requiring REST catalog properties as returned from Nessie Catalog. -
emptyConfigSource
-