]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.fileimport/src/org/simantics/fileimport/dropins/FileImportDropins.java
Sync git svn branch with SVN repository r33249.
[simantics/platform.git] / bundles / org.simantics.fileimport / src / org / simantics / fileimport / dropins / FileImportDropins.java
index 21a9f9ab0152fd5fab5d5a6d84d50e553d2a047f..6c07f92aaffcdfee2e40cab47714a34ec9b41fca 100644 (file)
@@ -5,6 +5,7 @@ import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
 import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;\r
 import static java.nio.file.StandardWatchEventKinds.OVERFLOW;\r
 \r
+import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
 import java.io.RandomAccessFile;\r
 import java.nio.file.FileSystem;\r
@@ -59,6 +60,8 @@ public class FileImportDropins {
      * Stop watching the dropins folder\r
      */\r
     public static void unwatchDropinsFolder() {\r
+        if (watcher == null)\r
+            return;\r
         watcher.stop();\r
         try {\r
             watcherThread.join(500);\r
@@ -139,7 +142,7 @@ public class FileImportDropins {
                             }\r
                             \r
                             FileImportService.performFileImport(newPath, Optional.of(t -> {\r
-                                if (t instanceof FileSystemException) {\r
+                                if ((t instanceof FileSystemException) || (t instanceof FileNotFoundException)) {\r
                                     try {\r
                                         syncPath(newPath);\r
                                     } catch (IOException e) {\r