private Map getConfigsToInstall()

in src/main/java/org/apache/sling/installer/provider/installhook/OsgiInstallerHook.java [325:357]


    private Map<String, InstallableResource> getConfigsToInstall(List<String> configResourcePaths, Session session,
            InstallationState installationState, PackageProperties packageProperties)
            throws IOException, InvalidSyntaxException, RepositoryException {
        Map<String, InstallableResource> configsToInstallByUrl = new HashMap<>();
        for (String configResourcePath : configResourcePaths) {
            boolean needsInstallation = false;

            String configUrl = URL_SCHEME + ":" + configResourcePath;
            boolean configFound = false;
            List<ResourceGroup> installedResources = installationState.getInstalledResources();
            for (ResourceGroup resourceGroup : installedResources) {
                for (Resource resource : resourceGroup.getResources()) {
                    if (StringUtils.equals(configUrl, resource.getURL())) {
                        configFound = true;
                        logger.log("Config " + configResourcePath + " is already installed");
                    }
                }
            }
            if (!configFound) {
                logger.log("Config " + configResourcePath + " has not been installed");
                needsInstallation = true;
            }

            if (needsInstallation) {

                Node node = session.getNode(configResourcePath);
                InstallableResource installableResource = convert(node, configResourcePath, packageProperties);

                configsToInstallByUrl.put(configUrl, installableResource);
            }
        }
        return configsToInstallByUrl;
    }