public static Set getPropertiesSet() { initOnce(); return props.entrySet(); }
public static void setProperties(Map properties) { initOnce(); for (Iterator i = properties.entrySet().iterator(); i.hasNext();) { Map.Entry e = (Map.Entry) i.next(); setProperty((String) e.getKey(), (String) e.getValue()); } }
public static String setProperty(String key, String value) { initOnce(); if (applyToJavaSystemProperties) { try { if (value == null) { System.getProperties().remove(key); } else { System.setProperty(key, value); } } catch (SecurityException e) { if (wanrOnce) { wanrOnce = false; Logger.error("Cannot update Java System.Properties", e); Logger.debug("Continue ME2 operations with no updates to system Properties"); } } } return (String) props.put(key, value); }
/** * Gets the system property indicated by the specified key. The only * function called by MIDlet * * @param key * the name of the system property * @return */ public static String getProperty(String key) { initOnce(); if (props.containsKey(key)) { return (String) props.get(key); } String v = getDynamicProperty(key); if (v != null) { return v; } try { return getSystemProperty(key); } catch (SecurityException e) { return null; } }
public static void setDevice(Device newDevice) { initOnce(); // Restore System Properties from previous device activation. if (systemPropertiesDevice != null) { for (Iterator iter = systemPropertiesDevice.iterator(); iter.hasNext();) { clearProperty((String) iter.next()); } } if (systemPropertiesPreserve != null) { for (Iterator i = systemPropertiesPreserve.entrySet().iterator(); i.hasNext();) { Map.Entry e = (Map.Entry) i.next(); setProperty((String) e.getKey(), (String) e.getValue()); } } systemPropertiesDevice = new Vector(); systemPropertiesPreserve = new HashMap(); for (Iterator i = newDevice.getSystemProperties().entrySet().iterator(); i.hasNext();) { Map.Entry e = (Map.Entry) i.next(); String key = (String) e.getKey(); if (props.containsKey(key)) { systemPropertiesPreserve.put(key, props.get(key)); } else { systemPropertiesDevice.add(key); } setProperty(key, (String) e.getValue()); } } }