Update nikiroo-utils, remove Instance.syserr/trace
[fanfix.git] / src / be / nikiroo / fanfix / DataLoader.java
index 0f3cad00de0b7a19d11e9ffd95b6421202f7b64a..2fd59d89764783cd9622fcc0249039dc012f1043 100644 (file)
@@ -99,8 +99,8 @@ public class DataLoader {
                // MUST NOT return null
                try {
                        InputStream in = cache.load(originalUrl, false, stable);
-                       Instance.trace("Cache " + (in != null ? "hit" : "miss") + ": "
-                                       + url);
+                       Instance.getTraceHandler().trace(
+                                       "Cache " + (in != null ? "hit" : "miss") + ": " + url);
 
                        if (in == null) {
                                try {
@@ -268,6 +268,18 @@ public class DataLoader {
                return cache.load(uniqueID, true, true);
        }
 
+       /**
+        * Remove the given resource from the cache.
+        * 
+        * @param uniqueID
+        *            a unique ID used to locate the cached resource
+        * 
+        * @return TRUE if it was removed
+        */
+       public boolean removeFromCache(String uniqueID) {
+               return cache.remove(uniqueID);
+       }
+
        /**
         * Clean the cache (delete the cached items).
         *