Fixed. When removing a file inside a folder and then upload another, thumbnails are...
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / adapter / DiskLruImageCache.java
index fceaba2..01fe5eb 100644 (file)
@@ -18,7 +18,7 @@ import android.util.Log;
 
 import com.jakewharton.disklrucache.DiskLruCache;
 import com.owncloud.android.BuildConfig;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
 
 public class DiskLruImageCache {
 
@@ -33,7 +33,7 @@ public class DiskLruImageCache {
     private StringBuffer mValidKeyBuffer = new StringBuffer(64);
     private StringBuffer mConversionBuffer = new StringBuffer(2).append('_'); 
             
-    private static final String TAG = "DiskLruImageCache";
+    private static final String TAG = DiskLruImageCache.class.getSimpleName();
 
     public DiskLruImageCache( Context context,String uniqueName, int diskCacheSize,
         CompressFormat compressFormat, int quality ) throws IOException {
@@ -186,4 +186,17 @@ public class DiskLruImageCache {
         return mValidKeyBuffer.toString();
     }
 
+    /**
+     * Remove passed key from cache
+     * @param key
+     */
+    public void removeKey( String key ) {
+        String validKey = convertToValidKey(key);
+        try {
+            mDiskCache.remove(validKey);
+            Log.d(TAG, "removeKey from cache: " + validKey);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 }
\ No newline at end of file