diff options
author | Ingo Bauersachs <ingo@jitsi.org> | 2017-01-14 18:53:40 +0100 |
---|---|---|
committer | Ingo Bauersachs <ingo@jitsi.org> | 2017-01-14 18:53:40 +0100 |
commit | 4c8ec00a2ae5233bf99c03808e7784c6246b3246 (patch) | |
tree | 3157b4cfa18ccab7c21dc1e06788037fa219996c /src | |
parent | 6eaa56d09126da3599180d34edb01eeba3aa724e (diff) | |
download | jitsi-4c8ec00a2ae5233bf99c03808e7784c6246b3246.zip jitsi-4c8ec00a2ae5233bf99c03808e7784c6246b3246.tar.gz jitsi-4c8ec00a2ae5233bf99c03808e7784c6246b3246.tar.bz2 |
Let the config service override the embedded resources
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java | 20 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java | 20 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java index 6c76906..1e7e7e4 100644 --- a/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java +++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementActivator.java @@ -19,6 +19,7 @@ package net.java.sip.communicator.impl.resources; import net.java.sip.communicator.util.*; +import org.jitsi.service.configuration.*; import org.jitsi.service.resources.*; import org.osgi.framework.*; @@ -31,6 +32,7 @@ public class ResourceManagementActivator extends SimpleServiceActivator<ResourceManagementServiceImpl> { static BundleContext bundleContext; + private static ConfigurationService configService; /** * Creates new instance of <tt>ResourceManagementActivator</tt> @@ -68,4 +70,22 @@ public class ResourceManagementActivator { return new ResourceManagementServiceImpl(); } + + /** + * Returns the <tt>ConfigurationService</tt> obtained from the bundle + * context. + * @return the <tt>ConfigurationService</tt> obtained from the bundle + * context + */ + public static ConfigurationService getConfigService() + { + if(configService == null) + { + configService + = ServiceUtils.getService( + bundleContext, + ConfigurationService.class); + } + return configService; + } } diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java index d116fea..1cc2dcf 100644 --- a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java +++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java @@ -344,4 +344,24 @@ public class ResourceManagementServiceImpl { return SkinJarBuilder.createBundleFromZip(zipFile, getImagePack()); } + + /** + * Gets the specified setting from the config service if present, otherwise + * from the embedded resources (resources/config/defaults.properties). + * + * @param key The setting to lookup. + * @return The setting for the key or {@code null} if not found. + */ + @Override + public String getSettingsString(String key) + { + Object configValue = ResourceManagementActivator + .getConfigService().getProperty(key); + if (configValue == null) + { + configValue = super.getSettingsString(key); + } + + return configValue == null ? null : configValue.toString(); + } } |