public static void listDir(JFrame jframe, Collection<File> files, Collection<File> folders, int depth,
                               final List<Pattern> dangerousFolders) {
        String frameTitle = jframe.getTitle();
        try {
            for (File folder : folders) {
                Log.info("Folder to scan: '" + folder.getAbsolutePath() + '\'');
                try {
                    files.addAll(org.apache.commons.io.FileUtils.listFiles(folder, null, false));
                    File[] subFolders;
                    subFolders = folder.listFiles((File pathname) -> {
                        boolean accept;
                        if (pathname.isDirectory()) {
                            accept = true;
                            for (Pattern dangerousPatt : dangerousFolders) {
                                if (StringHelper.checkRegex(pathname.getAbsolutePath(), dangerousPatt)) {
                                    accept = false;
                                    Log.info("Skipped hazardous place: '" + pathname + "'");
                                    break;
                                }
                            }
                        } else {
                            accept = false;
                        }
                        return accept;
                    });
                    if (depth > 0 && subFolders != null) {
                        for (File subFolder : subFolders) {
                            if (JFrameMain.isCLOSING_APP()) {
                                break;
                            }
                            files.add(subFolder);
                            listDirNoRecount(jframe, files, subFolder, depth - 1, dangerousFolders); // FIXME needs optimization (duplicated code: listDirNoRecount)
                        }
                    }
                } catch (Exception ex) {
                    Log.error(ex);
                }
            }
        } finally {
            jframe.setTitle(frameTitle);
        }
    }