ConfigDataLocationNotFoundException class final

The startup error for a required directory location that does not exist, such as spring.config.import=file:./config/ without a ./config/ directory.

It applies to directories named in spring.config.location, spring.config.additional-location or spring.config.import. An existing directory without config files is fine, but a wildcard location needs at least one subdirectory (file:./config/*/, configtree:/etc/config/*/), or one match when it names a file (file:./config/*/app.yml), as in Boot. Prefix the location with optional: when it may be missing. Applications meet it as a failed start; a missing single file gives ConfigDataResourceNotFoundException instead.

// --spring.config.import=file:./missing/
try {
  ConfigDataEnvironment(environment).processAndApplySync();
} on ConfigDataLocationNotFoundException catch (error) {
  log.error(error.location); // file:./missing/
}

Spring (Java):

// Thrown by SpringApplication.run for a missing non-optional directory.
try {
  SpringApplication.run(App.class, args);
} catch (ConfigDataLocationNotFoundException ex) {
  log.error(ex.getMessage());
}
Implemented types

Constructors

ConfigDataLocationNotFoundException(String location, {String? reason})
Creates the exception for location, with a reason when it is more specific than "cannot be found".

Properties

hashCode → int
The hash code for this object.
no setterinherited
location → String
The location as it was written, such as file:./config/.
final
reason → String?
Why it counts as not found when the directory exists, such as contains no subdirectories for a wildcard directory location; null for a directory that does not exist and for a wildcard location that finds nothing (Boot's "cannot be found").
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited