# HG changeset patch # User stechong # Date 1280247218 18000 # Node ID 3980cf3d4074e17645614d7c1a91f90cd6867420 # Parent b249ba29f64205ad4ea7f39e3f338132cbf5ab01 Update removeCache() to delete corresponding cache file saved to disk; also updated getCacheData() to remember cache loaded from disk. diff -r b249ba29f642 -r 3980cf3d4074 core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java --- 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 getCachedData(String cacheIdentifier, Class expectedClass, long freshness) { @@ -118,6 +122,7 @@ T result = cache.getData(expectedClass); if (cachedFreshness == freshness && result != null) { + caches.put(cacheIdentifier, cache); return result; } else