Skip to content

Commit

Permalink
Fixed sonarcloud warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Jul 24, 2023
1 parent 87952ec commit 049c1f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/imsweb/seerutils/SeerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;

import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
Expand Down Expand Up @@ -397,12 +396,13 @@ public static InputStream createInputStream(File file, String zipEntryToUse) thr
if (name.endsWith(".gz") || name.endsWith(".gzip"))
is = new GZIPInputStream(Files.newInputStream(file.toPath()));
else if (name.endsWith(".zip")) {
ZipFile zipFile = new ZipFile(file);
Enumeration<? extends ZipEntry> entries = zipFile.entries();
// count the number of entries
ZipSecureFile zipFile = new ZipSecureFile(file);

List<String> list = new ArrayList<>();
Enumeration<? extends ZipArchiveEntry> entries = zipFile.getEntries();
while (entries.hasMoreElements())
list.add(entries.nextElement().getName());

// can't be empty
if (list.isEmpty())
throw new IOException("Zip file is empty.");
Expand Down

0 comments on commit 049c1f0

Please sign in to comment.