Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
--- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Thu Aug 19 10:49:50 2010 -0500
+++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java Thu Aug 19 16:56:56 2010 -0500
@@ -343,6 +343,7 @@
entry.setEnabled(currSDK.isEnabled());
setSDKCacheEntry(entry);
}
+ flushSDKCache();
}
}
@@ -648,6 +649,14 @@
SDKCacheUtils.getCache().removeCache(SDK_MANAGER_CACHE_KEY, false);
}
+ protected void flushSDKCache() {
+ try {
+ SDKCacheUtils.getCache().flushCache(SDK_MANAGER_CACHE_KEY);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
@SuppressWarnings("unchecked")
protected List<String> getSDKCacheIdList() {
Map<String, SDKManagerCacheEntry> cacheMap = SDKCacheUtils.getCache().getCachedData(SDK_MANAGER_CACHE_KEY, Map.class, 0);
--- a/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java Thu Aug 19 10:49:50 2010 -0500
+++ b/core/com.nokia.cpp.utils.core/src/com/nokia/cpp/internal/api/utils/core/CacheUtils.java Thu Aug 19 16:56:56 2010 -0500
@@ -177,6 +177,13 @@
caches.clear();
}
+ public void flushCache(String identifier) throws Exception {
+ CacheEntry entry = caches.get(identifier);
+ if (entry != null) {
+ entry.flush();
+ }
+ }
+
public IPath getDefaultLocation() {
return defaultLocation;
}