Class ConfigTreePropertySource
- All Implemented Interfaces:
- OriginLookup<String>
PropertySource backed by a directory tree that contains files for each value.
 The PropertySource will recursively scan a given source directory and expose a
 property for each file found. The property name will be the filename, and the property
 value will be the contents of the file.
 
 Directories are only scanned when the source is first created. The directory is not
 monitored for updates, so files should not be added or removed. However, the contents
 of a file can be updated as long as the property source was created with a
 ConfigTreePropertySource.Option.ALWAYS_READ option. Nested directories are included in the source, but
 with a '.' rather than '/' used as the path separator.
 
 Property values are returned as ConfigTreePropertySource.Value instances which allows them to be treated
 either as an InputStreamSource or as a CharSequence. In addition, if
 used with an Environment configured with an
 ApplicationConversionService, property values can be converted to a
 String or byte[].
 
 This property source is typically used to read Kubernetes configMap volume
 mounts.
- Since:
- 2.4.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumProperty source options.static interfaceA value returned from the property source which exposes the contents of the property file.Nested classes/interfaces inherited from class org.springframework.core.env.PropertySourceorg.springframework.core.env.PropertySource.StubPropertySource
- 
Field SummaryFields inherited from class org.springframework.core.env.PropertySourcelogger, name, source
- 
Constructor SummaryConstructorsConstructorDescriptionConfigTreePropertySource(String name, Path sourceDirectory) Create a newConfigTreePropertySourceinstance.ConfigTreePropertySource(String name, Path sourceDirectory, ConfigTreePropertySource.Option... options) Create a newConfigTreePropertySourceinstance.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the origin of the given key ornullif the origin cannot be determined.getProperty(String name) String[]booleanReturntrueif this lookup is immutable and has contents that will never change.Methods inherited from class org.springframework.core.env.EnumerablePropertySourcecontainsPropertyMethods inherited from class org.springframework.core.env.PropertySourceequals, getName, getSource, hashCode, named, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.boot.origin.OriginLookupgetPrefix
- 
Constructor Details- 
ConfigTreePropertySourceCreate a newConfigTreePropertySourceinstance.- Parameters:
- name- the name of the property source
- sourceDirectory- the underlying source directory
 
- 
ConfigTreePropertySourcepublic ConfigTreePropertySource(String name, Path sourceDirectory, ConfigTreePropertySource.Option... options) Create a newConfigTreePropertySourceinstance.- Parameters:
- name- the name of the property source
- sourceDirectory- the underlying source directory
- options- the property source options
 
 
- 
- 
Method Details- 
getPropertyNames- Specified by:
- getPropertyNamesin class- org.springframework.core.env.EnumerablePropertySource<Path>
 
- 
getProperty- Specified by:
- getPropertyin class- org.springframework.core.env.PropertySource<Path>
 
- 
getOriginDescription copied from interface:OriginLookupReturn the origin of the given key ornullif the origin cannot be determined.- Specified by:
- getOriginin interface- OriginLookup<String>
- Parameters:
- name- the key to lookup
- Returns:
- the origin of the key or null
 
- 
isImmutablepublic boolean isImmutable()Description copied from interface:OriginLookupReturntrueif this lookup is immutable and has contents that will never change.- Specified by:
- isImmutablein interface- OriginLookup<String>
- Returns:
- if the lookup is immutable
 
 
-