Class ConfigLocation
SearchOrder.
path(String) means a directory, file(String) means one explicit file, and
envFile(String) means one explicit env file. Env files are never discovered unless
env loading is configured. See docs/config-locations.md and docs/env-files.md
for source-resolution details.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigLocationCreates a location that reads application classpath property resources.static ConfigLocationCreates a location that reads library defaults from META-INF/kiss-config/defaults.properties.static ConfigLocationenvFile()Creates a placeholder location for the env file configured onKissConfigBuilder.envFile(String).static ConfigLocationCreates a location that treats the value as one explicit env file.static ConfigLocationCreates a location that treats the value as one explicit env file.static ConfigLocationCreates a location backed by operating-system environment variables.booleanstatic ConfigLocationCreates a location that treats the value as one explicit file.static ConfigLocationCreates a location that treats the value as one explicit file.inthashCode()static ConfigLocationCreates a location that reads from the directory containing the running application JAR when available.path()Returns the configured path when this location has one.static ConfigLocationCreates a location that treats the value as a directory.static ConfigLocationCreates a location that treats the value as a directory.static ConfigLocationCreates a location backed by Java system properties.toString()type()Returns the location type.static ConfigLocationCreates a location that reads from the process working directory.
-
Method Details
-
classpath
Creates a location that reads application classpath property resources.With an active profile, the profile property resource is attempted after the base property resource.
- Returns:
- a classpath location
-
classpathLibraries
Creates a location that reads library defaults from META-INF/kiss-config/defaults.properties.This location does not scan arbitrary dependency
application.propertiesresources.- Returns:
- a classpath library defaults location
-
jarDirectory
Creates a location that reads from the directory containing the running application JAR when available.When the process is not running from a JAR, this location is skipped and reported.
- Returns:
- a JAR directory location
-
workingDirectory
Creates a location that reads from the process working directory.- Returns:
- a working directory location
-
path
Creates a location that treats the value as a directory.Directory locations load property files and profile property files. They load env files only when env loading is configured on the builder.
- Parameters:
directory- directory path- Returns:
- an explicit directory location
-
path
Creates a location that treats the value as a directory.Directory locations load property files and profile property files. They load env files only when env loading is configured on the builder.
- Parameters:
directory- directory path- Returns:
- an explicit directory location
-
file
Creates a location that treats the value as one explicit file.Missing explicit files fail unless
KissConfigBuilder.ignoreMissingExplicitFiles(boolean)is enabled.- Parameters:
file- file path- Returns:
- an explicit file location
-
file
Creates a location that treats the value as one explicit file.Missing explicit files fail unless
KissConfigBuilder.ignoreMissingExplicitFiles(boolean)is enabled.- Parameters:
file- file path- Returns:
- an explicit file location
-
envFile
Creates a placeholder location for the env file configured onKissConfigBuilder.envFile(String).If the builder has no env file configured, this location is skipped and reported. With an active profile, the builder-configured base env file is explicit and the generated profile variant is optional.
- Returns:
- a builder-configured env file location
-
envFile
Creates a location that treats the value as one explicit env file.This loads exactly the configured file path. Profile variants are not added automatically for explicit env paths.
- Parameters:
file- env file path- Returns:
- an explicit env file location
-
envFile
Creates a location that treats the value as one explicit env file.This loads exactly the configured file path. Profile variants are not added automatically for explicit env paths.
- Parameters:
file- env file path- Returns:
- an explicit env file location
-
systemProperties
Creates a location backed by Java system properties.- Returns:
- a system properties location
-
environmentVariables
Creates a location backed by operating-system environment variables.- Returns:
- an environment variables location
-
type
Returns the location type.- Returns:
- location type
-
path
Returns the configured path when this location has one.- Returns:
- optional path
-
equals
-
hashCode
public int hashCode() -
toString
-