Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbpennel. Nice! so the try() will auto close the fileStream... But... is the filter needed? Given the way caches are structured all files inside cachePath will need to be returned. Maybe for sanity just check if the file is regular file?
.filter(
Files::isRegularFile
) or something like that? I mean, just to save a few milliseconds per cycle... specially on large images with tons of derivativesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filter isn't a change in this PR, i didn't really evaluate whether it was needed or not. I'm fine with removing it if there isn't any concern of the cache path containing files that don't begin with the md5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbpennel thanks, true!, for the sake of not adding any point of rupture and because I don't know what use case the original Developer might had had in place, let's keep it! Approving. Thanks!