X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Finternal%2Fkernel%2FKernelUtils.java;h=0a9e6c53e44a2c24d7b438b526ce15ddda5f8214;hb=998f2785e9571572c21117da28fbd1d681cc33a4;hp=80c166e0a9db33fddfe94594ac842adbc1df4c59;hpb=d12f4cda6ff7b1de242a19362c3680f30ccc5168;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelUtils.java b/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelUtils.java index 80c166e0a..0a9e6c53e 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelUtils.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/kernel/KernelUtils.java @@ -15,7 +15,6 @@ import org.apache.commons.logging.Log; import org.argeo.cms.CmsException; import org.argeo.cms.KernelHeader; import org.argeo.cms.internal.auth.GrantedAuthorityPrincipal; -import org.osgi.framework.BundleContext; import org.springframework.security.authentication.AnonymousAuthenticationToken; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; @@ -46,9 +45,21 @@ class KernelUtils implements KernelConstants { return asDictionary(props); } - static File getOsgiInstanceDir(BundleContext bundleContext) { - return new File(bundleContext.getProperty(OSGI_INSTANCE_AREA) - .substring("file:".length())).getAbsoluteFile(); + static File getOsgiInstanceDir() { + return new File(Activator.getBundleContext() + .getProperty(OSGI_INSTANCE_AREA).substring("file:".length())) + .getAbsoluteFile(); + } + + static String getFrameworkProp(String key, String def) { + String value = Activator.getBundleContext().getProperty(key); + if (value == null) + return def; + return value; + } + + static String getFrameworkProp(String key) { + return getFrameworkProp(key, null); } // Security