class ConfigMapPropertySourceLocator implements PropertySourceLocator {

	private static final Log LOG = LogFactory.getLog(ConfigMapPropertySourceLocator.class);

	private final ConfigMapCache cache;

	protected final ConfigMapConfigProperties properties;

	/**
	 * This constructor is deprecated, and we do not use it anymore internally. It will be
	 * removed in the next major release.
	 */
	@Deprecated(forRemoval = true)
	public ConfigMapPropertySourceLocator(ConfigMapConfigProperties properties) {
		this.properties = properties;
		this.cache = new ConfigMapCache.NOOPCache();
	}

	public ConfigMapPropertySourceLocator(ConfigMapConfigProperties properties, ConfigMapCache cache) {
		this.properties = properties;
		this.cache = cache;
	}

	protected abstract MapPropertySource getMapPropertySource(NormalizedSource normalizedSource,
			ConfigurableEnvironment environment);

	@Override
	public PropertySource<?> locate(Environment environment) {
		if (environment instanceof ConfigurableEnvironment env) {

			CompositePropertySource composite = new CompositePropertySource("composite-configmap");
			if (this.properties.enableApi()) {
				Set<NormalizedSource> sources = new LinkedHashSet<>(this.properties.determineSources(environment));
				LOG.debug("Config Map normalized sources : " + sources);
				sources.forEach(s -> composite.addFirstPropertySource(getMapPropertySource(s, env)));
			}

			addPropertySourcesFromPaths(environment, composite);

			cache.discardAll();
			return composite;
		}
		return null;
	}

	@Override
	public Collection<PropertySource<?>> locateCollection(Environment environment) {
		return PropertySourceLocator.super.locateCollection(environment);
	}

	private void addPropertySourcesFromPaths(Environment environment, CompositePropertySource composite) {<FILL_FUNCTION_BODY>}

	private void addPropertySourceIfNeeded(Function<String, Map<String, Object>> contentToMapFunction, String content,
			String name, CompositePropertySource composite) {

		Map<String, Object> map = new HashMap<>(contentToMapFunction.apply(content));
		if (map.isEmpty()) {
			LOG.warn("Property source: " + name + "will be ignored because no properties could be found");
		}
		else {
			LOG.debug("will add file-based property source : " + name);
			composite.addFirstPropertySource(new MountConfigMapPropertySource(name, map));
		}
	}

}

		Set<String> uniquePaths = new LinkedHashSet<>(properties.paths());
		if (!uniquePaths.isEmpty()) {
			LOG.warn(
					"path support is deprecated and will be removed in a future release. Please use spring.config.import");
		}
		LOG.debug("paths property sources : " + uniquePaths);
		uniquePaths.stream().map(Paths::get).filter(p -> {
			boolean exists = Files.exists(p);
			if (!exists) {
				LOG.warn("Configured input path: " + p
						+ " will be ignored because it does not exist on the file system");
			}
			return exists;
		}).filter(p -> {
			boolean regular = Files.isRegularFile(p);
			if (!regular) {
				LOG.warn("Configured input path: " + p + " will be ignored because it is not a regular file");
			}
			return regular;
		}).toList().forEach(p -> {
			try {
				String content = new String(Files.readAllBytes(p)).trim();
				String filename = p.toAbsolutePath().toString().toLowerCase();
				if (filename.endsWith(".properties")) {
					addPropertySourceIfNeeded(c -> PROPERTIES_TO_MAP.apply(KEY_VALUE_TO_PROPERTIES.apply(c)), content,
							filename, composite);
				}
				else if (filename.endsWith(".yml") || filename.endsWith(".yaml")) {
					addPropertySourceIfNeeded(c -> PROPERTIES_TO_MAP.apply(yamlParserGenerator(environment).apply(c)),
							content, filename, composite);
				}
			}
			catch (IOException e) {
				LOG.warn("Error reading input file", e);
			}
		});
	
<no_super_class>