Package io.extact.rms.platform.config
Class ExternalPathConfigProvider
java.lang.Object
io.extact.rms.platform.config.ExternalPathConfigProvider
- All Implemented Interfaces:
org.eclipse.microprofile.config.spi.ConfigSourceProvider
public class ExternalPathConfigProvider
extends Object
implements org.eclipse.microprofile.config.spi.ConfigSourceProvider
Read the YAML file of the specified path from the outside.
There are two ways to specify the path from the outside, A and B, and
if both are set,A has priority.
Also, since this class is instantiated by ServiceLoader, if you want to use it, define this class in `META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider`
The path specification method is as follows.
Also, since this class is instantiated by ServiceLoader, if you want to use it, define this class in `META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider`
The path specification method is as follows.
Path by system property
$ java -Dext.config.path=/path/to/file MainClassPath by Environment variable
$ export EXT_CONFIG_PATH=/path/to/file $ java MainClassIf the path is not specified, nothing is done.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.eclipse.microprofile.config.spi.ConfigSource>
getConfigSources
(ClassLoader forClassLoader)
-
Field Details
-
PATH_PROP_NAME
- See Also:
-
PATH_ENV_NAME
- See Also:
-
-
Constructor Details
-
ExternalPathConfigProvider
public ExternalPathConfigProvider()
-
-
Method Details
-
getConfigSources
public Iterable<org.eclipse.microprofile.config.spi.ConfigSource> getConfigSources(ClassLoader forClassLoader) - Specified by:
getConfigSources
in interfaceorg.eclipse.microprofile.config.spi.ConfigSourceProvider
-