Skip to content

Commit

Permalink
avoid directory entries in zip archives
Browse files Browse the repository at this point in the history
  • Loading branch information
optyfr committed Apr 1, 2024
1 parent 05092ef commit 4995d3b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions jrmcore/src/main/java/jrm/profile/scan/DirScan.java
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,11 @@ private void scanZip(Container c, ScanOptions options) throws IOException
{
for(final var hdr : zipf.getFileHeaders())
{
final var entry = c.add(new Entry(ZipTools.toEntry(hdr.getFileName()), ZipTools.toEntry(hdr.getFileName())));
updateEntry(entry, zipf, hdr, options);
if(!hdr.isDirectory())
{
final var entry = c.add(new Entry(ZipTools.toEntry(hdr.getFileName()), ZipTools.toEntry(hdr.getFileName())));
updateEntry(entry, zipf, hdr, options);
}
}
c.setLoaded(options.needSha1OrMd5 ? 2 : 1);

Expand Down

0 comments on commit 4995d3b

Please sign in to comment.