Example usage for com.google.gwt.corp.localstorage LocalStorage getItem

List of usage examples for com.google.gwt.corp.localstorage LocalStorage getItem

Introduction

In this page you can find the example usage for com.google.gwt.corp.localstorage LocalStorage getItem.

Prototype

public static String getItem(String key) throws IOException 

Source Link

Usage

From source file:com.badlogic.gdx.backends.gwt.GwtPreferences.java

License:Apache License

GwtPreferences(String prefix) {
    this.prefix = prefix + ":";
    int prefixLength = this.prefix.length();
    try {/* ww w  .j  a  v  a  2  s.  c om*/
        for (int i = 0; i < LocalStorage.length(); i++) {
            String key = LocalStorage.key(i);
            if (key.startsWith(prefix)) {
                String value = LocalStorage.getItem(key);
                values.put(key.substring(prefixLength, key.length() - 1), toObject(key, value));
            }
        }
    } catch (Exception e) {
        values.clear();
    }
}