private void readBSNVerMap()

in src/main/java/org/apache/sling/feature/r2f/impl/RuntimeEnvironment2FeatureModelService.java [96:116]


    private void readBSNVerMap() {
        try {
            URI idbsnverFile = getDataFileURI(bundleContext, IDBSNVER_FILENAME);

            Properties properties = new Properties();
            try (InputStream is = idbsnverFile.toURL().openStream()) {
                properties.load(is);
            }

            for (String artifactId : properties.stringPropertyNames()) {
                String[] bsnver = properties.getProperty(artifactId).split("~");
                String bundleSymbolicName = bsnver[0];
                String bundleVersion = bsnver[1];
                Version version = Version.valueOf(bundleVersion);

                bvm.put(new AbstractMap.SimpleEntry<>(bundleSymbolicName, version), ArtifactId.parse(artifactId));
            }
        } catch (Exception e) {
            throw new IllegalStateException("An error occurred while loading 'idbsnver.properties' file, impossible to assemble the bundles map", e);
        }
    }