Library scanning much quicker
[nikiroo-utils.git] / src / be / nikiroo / fanfix / Cache.java
index 75a0f5d52e2c194a8d7b614b005387c38a088824..0166a37d1689fa6152ec7a451bf568071809302b 100644 (file)
@@ -15,7 +15,6 @@ import java.net.HttpURLConnection;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLConnection;
-import java.nio.file.FileAlreadyExistsException;
 import java.util.Date;
 import java.util.Map;
 import java.util.zip.GZIPInputStream;
@@ -228,7 +227,7 @@ public class Cache {
         * @param uniqueID
         *            a unique ID for this resource
         * 
-        * @return the resulting {@link FileAlreadyExistsException}
+        * @return the resulting {@link File}
         * 
         * @throws IOException
         *             in case of I/O error
@@ -302,7 +301,7 @@ public class Cache {
                conn.setRequestProperty("User-Agent", UA);
                conn.setRequestProperty("Cookie", generateCookies(support));
                conn.setRequestProperty("Accept-Encoding", "gzip");
-               if (support != null) {
+               if (support != null && support.getCurrentReferer() != null) {
                        conn.setRequestProperty("Referer", support.getCurrentReferer()
                                        .toString());
                        conn.setRequestProperty("Host", support.getCurrentReferer()