private Feature assemble()

in src/main/java/org/apache/sling/feature/launcher/impl/Bootstrap.java [199:229]


    private Feature assemble(final ArtifactManager artifactManager,
            Map<ArtifactId, Feature> loadedFeatures) throws IOException
    {
        if (this.config.getFeatureFiles().isEmpty() ) {
            File application = getApplicationFeatureFile(this.config);
            if (application.isFile()) {
                this.config.addFeatureFiles(application.toURI().toURL().toString());
            }
            else {
                Main.printHelp();
                throw new IllegalStateException("No feature(s) to launch found and none where specified");
            }
            return FeatureProcessor.createApplication(this.logger, this.config, artifactManager, loadedFeatures);
        }
        else
        {
            final Feature app = FeatureProcessor.createApplication(this.logger, this.config, artifactManager,
                    loadedFeatures);

            // write application back
            final File file = getApplicationFeatureFile(this.config);
            Files.createDirectories(file.getParentFile().toPath());

            try (final FileWriter writer = new FileWriter(file))
            {
                FeatureJSONWriter.write(writer, app);
            }

            return app;
        }
    }