dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java
/**
     * Extracts files from an archive.
     *
     * @param input the archive to extract files from
     * @param destination the location to write the files too
     * @param engine the dependency-check engine
     * @throws ArchiveExtractionException thrown if there is an exception
     * extracting files from the archive
     */
Extracts files from an archive.
@param input the archive to extract files from
@param destination the location to write the files too
@param engine the dependency-check engine
@throws ArchiveExtractionException thrown if there is an exception
extracting files from the archive
Extracts files from an archive . @param input the archive to extract files from @param destination the location to write the files too @param engine the dependency - check engine @throws ArchiveExtractionException thrown if there is an exception extracting files from the archive
private void extractArchive(ArchiveInputStream input, File destination, Engine engine) throws ArchiveExtractionException {
        ArchiveEntry entry;
        try {
            while ((entry = input.getNextEntry()) != null) {
                final File file = new File(destination, entry.getName());
                if (entry.isDirectory()) {
                    if (!file.exists() && !file.mkdirs()) {
                        final String msg = String.format("Unable to create directory '%s'.", file.getAbsolutePath());
                        throw new AnalysisException(msg);
                    }
                } else if (engine.accept(file)) {
                    extractAcceptedFile(input, file);
                }
            }
        } catch (IOException | AnalysisException ex) {
            throw new ArchiveExtractionException(ex);
        } finally {
            FileUtils.close(input);
        }
    }
private void extractArchive ( ArchiveInputStream input , File destination , Engine engine ) throws ArchiveExtractionException { ArchiveEntry entry ; try { while ( ( entry = input . getNextEntry ( ) ) != null ) { final File file = new File ( destination , entry . getName ( ) ) ; if ( entry . isDirectory ( ) ) { if ( ! file . exists ( ) && ! file . mkdirs ( ) ) { final String msg = String . format ( "Unable to create directory '%s'." , file . getAbsolutePath ( ) ) ; throw new AnalysisException ( msg ) ; } } else if ( engine . accept ( file ) ) { extractAcceptedFile ( input , file ) ; } } } catch ( IOException | AnalysisException ex ) { throw new ArchiveExtractionException ( ex ) ; } finally { FileUtils . close ( input ) ; } }
Extracts files from an archive.
Extracts files from an archive .