List of usage examples for com.google.gwt.storage.client StorageMap remove
@Override
public String remove(Object key)
From source file:com.data2semantics.yasgui.client.helpers.LocalStorageHelper.java
License:Open Source License
/** * Get value from local storage for given key. Appends current domain name to key, * as we want different local storage when yasgui is loaded via iframe. * /*from w w w . jav a 2 s . c o m*/ * @param key * @return */ private static String getFromLocalStorage(String key) { StorageMap storageMap = getStorageMap(); String domain = Helper.getCurrentHost(); if (storageMap.containsKey(domain + "_" + key)) { return storageMap.get(domain + "_" + key); } else if (storageMap.containsKey(key)) { //for backwards compatability (i.e. the time when we didnt use the basedomain as part of the key) String value = storageMap.get(key); setInLocalStorage(key, value); //settings it again stores it under correct key with domain name storageMap.remove(key);//remove old key return value; } return null; }