Methods Summary |
---|
public java.lang.String | getProperty(java.lang.String key)Gets a property of the suite. A property is an attribute from
either the application descriptor or JAR Manifest.
if (properties == null) {
loadProperties();
}
return properties.getProperty(key);
|
public int | getSuiteId()Gets the unique ID of the suite.
return suiteId;
|
native java.lang.String[] | load()Gets the suite properties from persistent store. Returns the
properties as an array of strings: key0, value0, key1, value1, etc.
|
void | loadProperties()Loads suite properties from persistent storage into a properties
object. If an IOException occurs, simply leaves the properties object
empty.
String[] propertyList;
properties = new Properties();
try {
propertyList = load();
} catch (IOException ioe) {
return;
}
/*
* Convert the string pairs into properties.
* JAD properties are stored before Manifest properties, but according
* to the MIDP spec, for untrusted applications, if an attribute in
* the descriptor has the same name as an attribute in the manifest
* the value from the descriptor must be used and the value from the
* manifest must be ignored. So bellow we loop through the properties
* backward to override the properties existing in the manifest.
*/
for (int i = propertyList.length - 2; i >= 0; i -= 2) {
properties.setProperty(propertyList[i], propertyList[i+1]);
}
|
public void | setTempProperty(java.lang.String key, java.lang.String value)Replace or add a property to the suite for this run only.
if (properties == null) {
loadProperties();
}
properties.setProperty(key, value);
|