Skip to content

Commit

Permalink
Fixes NoSuchFileException when reading files
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
  • Loading branch information
DarshitChanpura committed Apr 24, 2023
1 parent fa4307a commit 413e378
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import joptsimple.OptionSet;
import joptsimple.OptionSpec;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipEncodingHelper;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.lucene.search.spell.LevenshteinDistance;
import org.apache.lucene.util.CollectionUtil;
Expand Down Expand Up @@ -717,7 +718,7 @@ private Path unzip(Path zip, Path pluginsDir) throws IOException, UserException
final Path target = stagingDirectory(pluginsDir);
pathsToDeleteOnShutdown.add(target);

try (ZipFile zipFile = new ZipFile(zip.toString())) {
try (ZipFile zipFile = new ZipFile(zip, "UTF8", true, false)) {
final Enumeration<? extends ZipArchiveEntry> entries = zipFile.getEntries();
ZipArchiveEntry entry;
byte[] buffer = new byte[8192];
Expand Down

0 comments on commit 413e378

Please sign in to comment.