private void traverse()

in src/main/java/org/apache/sling/feature/cpconverter/vltpkg/BaseVaultPackageScanner.java [97:124]


    private void traverse(@Nullable String path, @NotNull Archive archive, @NotNull Entry entry, String runMode) throws IOException, ConverterException {
        String entryPath = newPath(path, entry.getName());

        if (entry.isDirectory()) {
            onDirectory(entryPath, archive, entry);

            //traverse all subdirectory first like stopwords/charfilter
            for (Entry child : entry.getChildren()) {
                if(child.isDirectory()) {
                    traverse(entryPath, archive, child, runMode);
                }
            }
            //traverse all files after that so that binaries all already has entries for stopwords/charfilter txt files.
            for (Entry child : entry.getChildren()) {
                if(!child.isDirectory()) {
                    traverse(entryPath, archive, child, runMode);
                }
            }

            return;
        }

        logger.debug("Processing entry {}...", entryPath);

        onFile(entryPath, archive, entry, runMode);

        logger.debug("Entry {} successfully processed.", entryPath);
    }