Package io.github.pimak.ntfy.core
Class ConfigLoader
java.lang.Object
io.github.pimak.ntfy.core.ConfigLoader
Resolves an
NtfyConfig from the ambient environment. This is the ONLY class in ntfy-core
permitted to read System.getenv(java.lang.String) — every other class receives its configuration through an
already-built NtfyConfig, keeping environment access to a single sanctioned reader.
Each field is resolved by precedence, highest first:
- JVM system property
ntfy.<kebab-key>(e.g.-Dntfy.app-name=svc); - environment variable
NTFY_<UPPER_SNAKE_KEY>(e.g.NTFY_APP_NAME); - classpath
ntfy.propertiesentryntfy.<kebab-key>; - the built-in default carried by
NtfyConfig.Builder.
Exception: allow-classpath-endpoint is deliberately resolved from the
system-property and environment layers only — never the classpath ntfy.properties file —
so a file shipped on the classpath can never grant itself the trust to auto-activate alerting
(see load()).
-
Method Summary
Modifier and TypeMethodDescriptionstatic NtfyConfigload()Loads configuration from live system properties, environment variables, and a classpathntfy.properties(if present), applying the precedence documented on this class.
-
Method Details
-
load
Loads configuration from live system properties, environment variables, and a classpathntfy.properties(if present), applying the precedence documented on this class.
-