add paramater to allow cache to be deleted or not when a refresh is done (you don't want to delete the cache on disk in the case of Symbian SDKs b/c C3_BUILDER_WORK
authortimkelly
Wed, 18 Aug 2010 13:58:10 -0500
branchC3_BUILDER_WORK
changeset 1857 5b2d8f8c613b
parent 1847 5a696c4ef747
child 1861 b068cf1b44ee
add paramater to allow cache to be deleted or not when a refresh is done (you don't want to delete the cache on disk in the case of Symbian SDKs b/c if the IDE quits abnormally the cache in memory is not written to disk.
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java
core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java
core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java	Tue Aug 17 15:50:47 2010 -0700
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/sbsv2/SBSv2QueryUtils.java	Wed Aug 18 13:58:10 2010 -0500
@@ -472,15 +472,15 @@
 	}
 
 	public static void removeCachedAliases() {
-		SDKCacheUtils.getCache().removeCache(ALIAS_CACHE_KEY);
+		SDKCacheUtils.getCache().removeCache(ALIAS_CACHE_KEY, true);
 	}
 
 	public static void removeCachedProducts() {
-		SDKCacheUtils.getCache().removeCache(PRODUCT_CACHE_KEY);		
+		SDKCacheUtils.getCache().removeCache(PRODUCT_CACHE_KEY, true);		
 	}
 
 	public static void removeCachedConfigurations() {
-		SDKCacheUtils.getCache().removeCache(CONFIG_CACHE_KEY);
+		SDKCacheUtils.getCache().removeCache(CONFIG_CACHE_KEY, true);
 	}
 
 }
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java	Tue Aug 17 15:50:47 2010 -0700
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java	Wed Aug 18 13:58:10 2010 -0500
@@ -645,7 +645,7 @@
 	}
 
 	protected void clearSDKCache() {
-		SDKCacheUtils.getCache().removeCache(SDK_MANAGER_CACHE_KEY);
+		SDKCacheUtils.getCache().removeCache(SDK_MANAGER_CACHE_KEY, false);
 	}
 
 	@SuppressWarnings("unchecked")
--- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java	Tue Aug 17 15:50:47 2010 -0700
+++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java	Wed Aug 18 13:58:10 2010 -0500
@@ -102,11 +102,13 @@
 		return result;		
 	}
 
-	public void removeCache(String identifier) {
+	public void removeCache(String identifier, boolean removeFromDisk) {
 		CacheEntry cache = caches.get(identifier);
 		if (cache != null) {
 			caches.remove(identifier);
-			cache.delete();
+			if (removeFromDisk){
+				cache.delete();
+			}
 		}
 	}