X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2FDownloader.java;h=0487933295ec8c4902665d2bffcd81e57debda2c;hb=8c227da67c11370980154c61861bcfb9c73881c5;hp=b1ac56c0508300e6fee02eada0affd499117b7a8;hpb=1002f328e2b216cc7e92b75eeaae5d2f89249fe5;p=fanfix.git diff --git a/src/be/nikiroo/utils/Downloader.java b/src/be/nikiroo/utils/Downloader.java index b1ac56c..0487933 100644 --- a/src/be/nikiroo/utils/Downloader.java +++ b/src/be/nikiroo/utils/Downloader.java @@ -281,7 +281,9 @@ public class Downloader { } } - if (offline) { + String protocol = originalUrl == null ? null : originalUrl + .getProtocol(); + if (isOffline() && !"file".equalsIgnoreCase(protocol)) { tracer.error("Downloader OFFLINE, cannot proceed to URL: " + url); throw new IOException("Downloader is currently OFFLINE, cannot download: " + url); } @@ -397,6 +399,11 @@ public class Downloader { } } + if (in == null) { + throw new IOException( + "Cannot retrieve the file after storing it in the cache (??)"); + } + return in; } catch (IOException e) { throw new IOException(String.format(