public void postJars()

in atomosfeaturelauncherconfig/src/main/java/org/apache/sling/feature/launcher/atomos/config/IndexPlugin.java [204:267]


    public void postJars(Context context) {
        try {

            final List<String> bundleIndexLines = new ArrayList<>();
            final Collection<String> resources = new LinkedHashSet<>();
            indexInfos.stream() //
                    .filter((i) -> i.getBundleSymbolicName() != null) //
                    .sorted(Comparator.comparing(IndexInfo::getBundleSymbolicName)) //
                    .forEach((i) -> {
                        bundleIndexLines.add(ATOMOS_BUNDLE_SEPARATOR);
                        bundleIndexLines.add(i.getId());
                        bundleIndexLines.add(i.getBundleSymbolicName());
                        bundleIndexLines.add(i.getVersion());
                        i.getFiles().forEach(f -> {
                            bundleIndexLines.add(f);
                            if (!isClass(f)) {
                                if (Boolean.FALSE == uniquePaths.get(f)) {
                                    resources.add(
                                            ATOMOS_BUNDLES_BASE_PATH + i.getId() + "/" + f);
                                }
                                if (!f.endsWith("/") && !"META-INF/MANIFEST.MF".equals(f)) {
                                    resources.add(f);
                                }
                            }
                        });
                    });

            ByteArrayOutputStream indexBytes;
            try (final ByteArrayOutputStream out = new ByteArrayOutputStream();
                 BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out))) {
                indexBytes = out;
                bundleIndexLines.forEach((l) -> {
                    try {
                        writer.append(l).append('\n');
                    } catch (final IOException ex) {
                        throw new UncheckedIOException(ex);
                    }
                });
            }
            writeIndexFile(indexBytes.toByteArray(), context);

            if (isJarType()) {
                writeGraalResourceConfig(resources, context);
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (jos != null) {
                try {
                    jos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

        //after closing
        if (isJarType()) {
            context.addFile(substrateJar, FileType.INDEX_JAR);
        } else {
            context.addFile(config.indexOutputDirectory(), FileType.INDEX_DIR);

        }
    }