Handling of files for which no importer (or too many) is present does not fail with an exception#258
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #258 +/- ##
=============================================
- Coverage 87.29% 87.25% -0.04%
Complexity 1034 1034
=============================================
Files 120 120
Lines 3187 3193 +6
Branches 249 250 +1
=============================================
+ Hits 2782 2786 +4
Misses 335 335
- Partials 70 72 +2
Continue to review full report at Codecov.
|
…le to deal with any type of file. If no importer is present than nothing is imported (silently, with a LOG.info message in ImporterFactoryLoader). No special handling in ZipFileImporter necesssary anymore.
…into feature/257-only_import_support_files_from_zip_files
|
Bitte noch bei Bedarf Requirements und Design aktualisieren :) |
|
Build for PR from fork failed because of missing SONAR_TOKEN. We still can merge this. |
|
Can we merge this pull request to develop or is something still open? Should @redcatbear also do a review? |
|
Yes, he should also review. |
|
|
||
|
|
| * when no or more than one {@link ImporterFactory} is found. | ||
| */ | ||
| public ImporterFactory getImporterFactory(final InputFile file) | ||
| public Optional<ImporterFactory> getImporterFactory(final InputFile file) |
There was a problem hiding this comment.
Please split into check method and getter method instead of using Optional. Use getter only if check comes back green.
There was a problem hiding this comment.
This would mean that the ImporterFactory needs to be searched twice: once by the check method to figure out that there is a fitting ImporterFactory and second by the get method. Th search calls ImporterFactory.supportsFile() on each factory when then figures out by examine the given file if it can load the file.
What is the problem with Optional. As Java has no Either construct, isn't Optional not the Java approach for such a construct?
| LOG.fine(() -> ( importer.isPresent() ? | ||
| "Created importer of type '" + importer.getClass().getSimpleName() : | ||
| "No import" ) |
There was a problem hiding this comment.
| LOG.fine(() -> ( importer.isPresent() ? | |
| "Created importer of type '" + importer.getClass().getSimpleName() : | |
| "No import" ) | |
| LOG.fine(() -> (importer.isPresent() ? | |
| "Created importer of type '" + importer.getClass().getSimpleName() : | |
| "No import") |
Please use auto-formatting. that should also make sure that all spaces are uniform.
|
Build failing. |
|
Build fails during sonar analysis with message Root cause is, that pr from forks don't have access to the sonar token. I fixed this issue on I will merge the pr as is. We can fix potential sonar findings later. |
…t_files_from_zip_files Handling of files for which no importer (or too many) is present does not fail with an exception
…t_files_from_zip_files Handling of files for which no importer (or too many) is present does not fail with an exception
Uh oh!
There was an error while loading. Please reload this page.