Class ApiKeyResolver

java.lang.Object
io.root.patcher.ApiKeyResolver

public class ApiKeyResolver extends Object
Resolves the Root.io API key from the environment, JVM system properties, or a .env file.
  • Constructor Details

  • Method Details

    • resolve

      public Optional<String> resolve(File projectRootDir)
      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 .env file
      Returns:
      the resolved API key, or Optional.empty() if none found