class DirectoryConfigSource extends AbstractConfigSource implements PollableSource<Instant>,
                   WatchableSource<Path>,
                   NodeConfigSource {

    @Override
    public Optional<NodeContent> load() throws ConfigException {
        if (!Files.exists(directoryPath)) {
            return Optional.empty();
        }
        try {
            ConfigNode.ObjectNode.Builder objectNodeRoot = ConfigNode.ObjectNode.builder();

            Files.walk(directoryPath, 1, FOLLOW_LINKS)
                    .filter(Files::isRegularFile)
                    .forEach(path -> {
                        String content = FileSourceHelper.safeReadContent(path);
                        objectNodeRoot.addValue(path.getFileName().toString(), content);
                    });


            NodeContent.Builder builder = NodeContent.builder()
                    .node(objectNodeRoot.build());

            lastModifiedTime(directoryPath).ifPresent(builder::stamp);

            return Optional.of(builder.build());
        } catch (ConfigException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new ConfigException("Configuration at directory '" + directoryPath + "' is not accessible.", ex);
        }
    }

      DirectoryConfigSource(Builder builder);

}