/** * 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 int checkPermission(String permission) { return MIDletSystemProperties.getPermission(permission); }
/** * This code Ingected By MicroEmulator to enable access to System properties while running in Applet * * @param key the name of the system property. * @return the string value of the system property, * or <code>null</code> if there is no property with that key. */ public static String getProperty(String key) { return MIDletSystemProperties.getProperty(key); }
private static void initOnce() { // Can't use static initializer because of applyToJavaSystemProperties // in applet if (initialized) { return; } initialized = true; // This are set in Config // setProperty("microedition.configuration", "CLDC-1.1"); // setProperty("microedition.profiles", "MIDP-2.0"); setProperty("microedition.platform", "MicroEmulator"); setProperty("microedition.encoding", getSystemProperty("file.encoding")); }
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 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()); } } }
public static Set getPropertiesSet() { initOnce(); return props.entrySet(); }
public static String getSystemProperty(String key) { try { if (acc != null) { return getSystemPropertySecure(key); } else { return System.getProperty(key); } } catch (SecurityException e) { return null; } }
public void setDevice(Device device) { MIDletSystemProperties.setDevice(device); DeviceFactory.setDevice(device); }
String systemTmpDir = MIDletSystemProperties.getSystemProperty("java.io.tmpdir"); if (systemTmpDir != null) { tmpDir = new File(systemTmpDir, "microemulator-apps-" + MIDletSystemProperties.getSystemProperty("user.name")); if ((!tmpDir.exists()) && (!tmpDir.mkdirs())) { tmpDir = null;
MIDletSystemProperties.setProperties(systemProperties);
public Common(EmulatorContext context) { instance = this; this.emulatorContext = context; /* * Initialize secutity context for implemenations, May be there are better place * for this call */ ImplFactory.instance(); MIDletSystemProperties.initContext(); // TODO integrate with ImplementationInitialization ImplFactory.registerGCF(ImplFactory.DEFAULT, new ConnectorImpl()); MIDletBridge.setMicroEmulator(this); }
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); }