From 184b90946c64469fb29a421e3b62e9534c223dbf Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Tue, 16 Oct 2018 10:20:40 +0200
Subject: [PATCH] when file is downloaded partially isCached returns false

---
 .../java/lcsb/mapviewer/annotation/cache/BigFileCache.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/BigFileCache.java b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/BigFileCache.java
index c81f8cf544..e9c8b39fe0 100644
--- a/annotation/src/main/java/lcsb/mapviewer/annotation/cache/BigFileCache.java
+++ b/annotation/src/main/java/lcsb/mapviewer/annotation/cache/BigFileCache.java
@@ -848,6 +848,10 @@ public class BigFileCache {
         logger.warn("File is supposed to be cached but it's not there... " + sourceUrl);
         return false;
       }
+      if (entry.getDownloadProgress() == null || entry.getDownloadProgress() < 100.0) {
+        logger.warn("File is not complete: " + entry.getLocalPath() + ".");
+        return false;
+      }
     }
     return entry != null;
   }
-- 
GitLab