private boolean getBoolean(ISecurePreferences settings, String key) { try { return settings.getBoolean(key, false); } catch (StorageException e) { return false; } }
public ProxyPreferencesHandler() { try { ISecurePreferences securePref = SecurePreferencesFactory.getDefault(); node = securePref.node("proxy"); staticMethod = node.get("method", "No proxy"); staticAuthRequired = false; staticHost = node.get("host", ""); staticPort = node.get("port", ""); staticAuthRequired = node.getBoolean("authRequired", false); if (staticAuthRequired) { staticUser = node.get("user", ""); staticPass = node.get("password", ""); } } catch (StorageException e1) { e1.printStackTrace(); staticMethod = "No proxy"; } }