forked from I2P_Developers/i2p.i2p
add int getProperty(String prop, int default)
This commit is contained in:
@@ -329,6 +329,23 @@ public class RouterContext extends I2PAppContext {
|
||||
return super.getProperty(propName, defaultVal);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an int with an int default
|
||||
*/
|
||||
public int getProperty(String propName, int defaultVal) {
|
||||
if (_router != null) {
|
||||
String val = _router.getConfigSetting(propName);
|
||||
if (val != null) {
|
||||
int ival = defaultVal;
|
||||
try {
|
||||
ival = Integer.parseInt(val);
|
||||
} catch (NumberFormatException nfe) {}
|
||||
return ival;
|
||||
}
|
||||
}
|
||||
return super.getProperty(propName, defaultVal);
|
||||
}
|
||||
|
||||
/**
|
||||
* The context's synchronized clock, which is kept context specific only to
|
||||
* enable simulators to play with clock skew among different instances.
|
||||
|
Reference in New Issue
Block a user