Update removeCache() to delete corresponding cache file saved to disk; also updated getCacheData() to remember cache loaded from disk.
--- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java Tue Jul 27 10:31:29 2010 -0500
+++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java Tue Jul 27 11:13:38 2010 -0500
@@ -103,7 +103,11 @@
}
public void removeCache(String identifier) {
- caches.remove(identifier);
+ CacheEntry cache = caches.get(identifier);
+ if (cache != null) {
+ caches.remove(cache);
+ cache.delete();
+ }
}
public <T> T getCachedData(String cacheIdentifier, Class<T> expectedClass, long freshness) {
@@ -118,6 +122,7 @@
T result = cache.getData(expectedClass);
if (cachedFreshness == freshness && result != null)
{
+ caches.put(cacheIdentifier, cache);
return result;
}
else