private void collectFromArchive()

in src/org/jetbrains/jps/builders/javacApi/OptimizedFileManager.java [96:124]


    private void collectFromArchive(File root, Archive archive, String relativePath, Set<JavaFileObject.Kind> kinds, boolean recurse, ListBuffer<JavaFileObject> result) {
        if (archive == null) {
            try {
                archive = openArchive(root);
            } catch (IOException ex) {
                log.error("error.reading.file", root, ex.getLocalizedMessage());
                return;
            }
        }
        String separator = myUseZipFileIndex ? File.separator : "/";
        if (relativePath.length() != 0) {
            if (!myUseZipFileIndex) {
                relativePath = relativePath.replace('\\', '/');
            }
            if (!relativePath.endsWith(separator)) relativePath = relativePath + separator;
        }

        collectArchiveFiles(archive, relativePath, kinds, result);
        if (recurse) {
            for (String s : archive.getSubdirectories()) {
                if (s.startsWith(relativePath) && !s.equals(relativePath)) {
                    if (!s.endsWith(separator)) {
                        s += separator;
                    }
                    collectArchiveFiles(archive, s, kinds, result);
                }
            }
        }
    }