public IndexerDirectoryInformation parse(Path path) {
        if (!Files.exists(path)) {
            throw new IndexerInformationParserException("Path " + path + " does not exist.");
        }

        if (!Files.isDirectory(path)) {
            throw new IndexerInformationParserException("Path " + path + " is not a directory");
        }

        if (!Files.isReadable(path)) {
            throw new IndexerInformationParserException("Path " + path + " is not readable");
        }

        final Path nodesPath = path.resolve("nodes");

        if (!Files.exists(nodesPath)) {
            return IndexerDirectoryInformation.empty(path);
        }

        try (final Stream<Path> nodes = Files.list(nodesPath)) {
            final List<NodeInformation> nodeInformation = nodes.filter(Files::isDirectory)
                    .filter(p -> p.getFileName().toString().matches("\\d+"))
                    .map(this::parseNode)
                    .filter(node -> !node.isEmpty())
                    .toList();
            return new IndexerDirectoryInformation(path, nodeInformation);
        } catch (IOException e) {
            throw new IndexerInformationParserException("Failed to list nodes", e);
        }
    }
@Test
    void testOpensearch1() throws URISyntaxException {
        final URI uri = getClass().getResource("/indices/opensearch1").toURI();
        final IndexerDirectoryInformation result = parser.parse(Path.of(uri));
        Assertions.assertThat(result.nodes())
                .hasSize(1)
                .allSatisfy(node -> {
                    Assertions.assertThat(node.nodeVersion()).isEqualTo("1.3.0");
                    Assertions.assertThat(node.indices())
                            .hasSize(1)
                            .extracting(IndexInformation::indexName)
                            .contains("graylog_0");

                    final IndexInformation graylog_0 = node.indices().stream().filter(i -> i.indexName().equals("graylog_0")).findFirst().orElseThrow(() -> new RuntimeException("Failed to detect graylog_0 index"));

                    Assertions.assertThat(graylog_0.indexVersionCreated()).isEqualTo("1.3.0");

                    Assertions.assertThat(graylog_0.shards())
                            .hasSize(1)
                            .allSatisfy(shard -> {
                                Assertions.assertThat(shard.documentsCount()).isEqualTo(1);
                                Assertions.assertThat(shard.name()).isEqualTo("S0");
                                Assertions.assertThat(shard.primary()).isEqualTo(true);
                                Assertions.assertThat(shard.minLuceneVersion()).isEqualTo("8.10.1");
                            });
                });
    }