aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/configuration
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-13 11:32:24 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-13 11:32:24 +0000
commit89f728384cd9941fbc045e01b5f4cb2758cc1aea (patch)
tree07345d19a188c1564af7680eb7486e44c8d156e6 /src/net/java/sip/communicator/impl/configuration
parent974151c18cf4c49b6b074fce749bd1c06b31aa39 (diff)
downloadjitsi-89f728384cd9941fbc045e01b5f4cb2758cc1aea.zip
jitsi-89f728384cd9941fbc045e01b5f4cb2758cc1aea.tar.gz
jitsi-89f728384cd9941fbc045e01b5f4cb2758cc1aea.tar.bz2
Minor elimination of code duplication.
Diffstat (limited to 'src/net/java/sip/communicator/impl/configuration')
-rw-r--r--src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java b/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java
index 07f31c4..ee46df1 100644
--- a/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/configuration/ConfigurationServiceImpl.java
@@ -1071,6 +1071,27 @@ public class ConfigurationServiceImpl
.parseBoolean(stringValue);
}
+ public int getInt(String propertyName, int defaultValue)
+ {
+ String stringValue = getString(propertyName);
+ int intValue = defaultValue;
+
+ if (stringValue != null)
+ {
+ try
+ {
+ intValue = Integer.parseInt(stringValue);
+ }
+ catch (NumberFormatException ex)
+ {
+ logger.error(propertyName
+ + " does not appear to be an integer. " + "Defaulting to "
+ + defaultValue + ".", ex);
+ }
+ }
+ return intValue;
+ }
+
/**
* We use property references when we'd like to store system properties.
* Simply storing System properties in our properties Map would not be