openfasttrace icon indicating copy to clipboard operation
openfasttrace copied to clipboard

import only readable files from zip files

Open poldi2015 opened this issue 4 years ago • 1 comments

Problem Importing ZIP file fails with an exception if the ZIP file contains files for which no importer is present. The behavior is specifically annoying in case of dependencies imported via the gradle plugin.

Describe the solution you'd like The ZipFileImporter is extended to only select files for which an importer is registered to openfasttrace.

poldi2015 avatar Apr 16 '21 11:04 poldi2015

I've got already a first implementation, need to try out if if can be implemented more efficiently and add some tests.

poldi2015 avatar Apr 16 '21 11:04 poldi2015

@kaklakariada, please reproduce. I think we should skip files for which we have no importer.

redcatbear avatar Jan 04 '23 09:01 redcatbear

I cannot reproduce this. Importing a zip file with an unsupported file just logs a INFO message:

example % unzip -l archive.zip 
Archive:  archive.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
       46  01-04-2023 13:44   file.unsupported
---------                     -------
       46                     1 file
example % oft trace                       
Jan 04, 2023 1:45:07 PM org.itsallcode.openfasttrace.core.importer.ImporterFactoryLoader getImporterFactory
INFO: Found no matching importer for file '.../openfasttrace/product/src/test/resources/example/archive.zip!file.unsupported'
ok - 10 total

kaklakariada avatar Jan 04 '23 12:01 kaklakariada

@poldi2015 we could not reproduce this with the current version from main branch. Please re-open this issue and add instructions to reproduce this if necessary.

kaklakariada avatar Jan 04 '23 14:01 kaklakariada