From 880ac44451ce9a6dd106b38b7e462211cb2012a3 Mon Sep 17 00:00:00 2001 From: Evgeny Zaharchenko Date: Wed, 24 Oct 2018 12:59:07 +0400 Subject: [PATCH] Fix issue with autoimport zip archives from classpath #19 (cherry picked from commit 689cb8984030165487999b459420e03bbbef65bc) --- .../auto_import/processors/DefaultAutoImportProcessor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/core/src/com/haulmont/addon/admintools/core/auto_import/processors/DefaultAutoImportProcessor.java b/modules/core/src/com/haulmont/addon/admintools/core/auto_import/processors/DefaultAutoImportProcessor.java index b6b9091..7c906ed 100644 --- a/modules/core/src/com/haulmont/addon/admintools/core/auto_import/processors/DefaultAutoImportProcessor.java +++ b/modules/core/src/com/haulmont/addon/admintools/core/auto_import/processors/DefaultAutoImportProcessor.java @@ -19,7 +19,6 @@ import javax.inject.Inject; import java.io.*; -import java.util.zip.ZipFile; import static com.google.common.io.Files.getFileExtension; import static java.lang.String.format; @@ -48,7 +47,9 @@ public class DefaultAutoImportProcessor implements AutoImportProcessor { @Override public void processFile(String filePath) throws Exception { FileType fileType = FileType.getEnum(getFileExtension(filePath)); - + if (!resources.getResource(filePath).exists()) { + throw new FileNotFoundException(filePath); + } switch (fileType) { case ZIP: processZipFile(filePath);