Package io.root.patcher
Class ApiKeyResolver
java.lang.Object
io.root.patcher.ApiKeyResolver
Resolves the Root.io API key from the environment, JVM system properties, or a
.env file.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a resolver that reads environment variables viaSystem.getenv(java.lang.String). -
Method Summary
-
Constructor Details
-
ApiKeyResolver
public ApiKeyResolver()Creates a resolver that reads environment variables viaSystem.getenv(java.lang.String).
-
-
Method Details
-
resolve
Resolves the Root.io API key from available sources in ascending priority order: .env file < system property < environment variable. Returns Optional.empty() if no source provides a non-empty value.- Parameters:
projectRootDir- project root directory; used to locate the.envfile- Returns:
- the resolved API key, or
Optional.empty()if none found
-