private static Map reload()

in microprofile-extensions/microprofile-extensions-config/docker-configsource/src/main/java/org/apache/geronimo/microprofile/extensions/config/docker/DockerSecretConfigSource.java [47:63]


    private static Map<String, String> reload(final String base) {
        final Path from = Paths.get(base);
        if (!Files.exists(from)) {
            return emptyMap();
        }
        try {
            return Files.list(from).collect(toMap(it -> it.getFileName().toString(), it -> {
                try {
                    return new String(Files.readAllBytes(it), StandardCharsets.UTF_8);
                } catch (final IOException e) {
                    throw new IllegalStateException(e);
                }
            }));
        } catch (final IOException e) {
            throw new IllegalStateException(e);
        }
    }