Skip to content

Commit

Permalink
Update AbstractAddFileToZipTask.java (#239)
Browse files Browse the repository at this point in the history
Skip files which no longer exist
  • Loading branch information
JarFiles authored Sep 28, 2020
1 parent 2f1422f commit a20fcf8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private void addFileToZip(File fileToAdd, ZipOutputStream zipOutputStream, ZipPa

zipOutputStream.putNextEntry(zipParameters);

if (!fileToAdd.isDirectory()) {
if (fileToAdd.exists() && !fileToAdd.isDirectory()) {
try (InputStream inputStream = new FileInputStream(fileToAdd)) {
while ((readLen = inputStream.read(readBuff)) != -1) {
zipOutputStream.write(readBuff, 0, readLen);
Expand Down

0 comments on commit a20fcf8

Please sign in to comment.