List of usage examples for com.google.gwt.gears.client Factory getPermission
public native boolean getPermission() ;
From source file:de.lilawelt.zmachine.client.storage.GearsAdapterReal.java
License:Open Source License
public boolean Initialize() throws StorageException { if (initialized) return true; Factory f = Factory.getInstance(); if (f == null) throw new StorageException("Gears could not be initialized"); if ((!f.hasPermission()) && (!f.getPermission())) throw new StorageException("Sorry, this site may not access your gears installation"); Log.debug("Trying gears init..."); // Create the database if it doesn't exist. try {// ww w . j ava2 s . com db = f.createDatabase(); db.open("textadventure-saves"); // The 'int' type will store up to 8 byte ints depending on the magnitude of the // value added. db.execute( "create table if not exists saves (savename text, gameuid text, savedate date, savedata blob)"); } catch (GearsException e) { throw new StorageException( "Sorry, an error was encountered while initializing gears: " + e.getMessage()); } Log.debug("Dine with gears init"); initialized = true; return true; }