List of usage examples for com.google.gwt.storage.client StorageMap get
@Override
public String get(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. * // w w w. ja va 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; }