X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Finternal%2Fruntime%2FKernelUtils.java;h=60c796af73280639bc8f03868ec5ec67ed03cbb9;hb=eb4324be6ac9cdff15828a21ee7d3f6ca2f19fb9;hp=afcb9ff26a77d68502373e86a5eb2fd84280fa3d;hpb=f4da6777015da3fc392138f0c01cea2f2add9ed3;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.cms/src/org/argeo/cms/internal/runtime/KernelUtils.java b/org.argeo.cms/src/org/argeo/cms/internal/runtime/KernelUtils.java index afcb9ff26..60c796af7 100644 --- a/org.argeo.cms/src/org/argeo/cms/internal/runtime/KernelUtils.java +++ b/org.argeo.cms/src/org/argeo/cms/internal/runtime/KernelUtils.java @@ -63,10 +63,10 @@ public class KernelUtils implements KernelConstants { } } - static File getOsgiInstanceDir() { - return new File(CmsActivator.getBundleContext().getProperty(OSGI_INSTANCE_AREA).substring("file:".length())) - .getAbsoluteFile(); - } +// static File getOsgiInstanceDir() { +// return new File(CmsActivator.getBundleContext().getProperty(OSGI_INSTANCE_AREA).substring("file:".length())) +// .getAbsoluteFile(); +// } public static Path getOsgiInstancePath(String relativePath) { return Paths.get(getOsgiInstanceUri(relativePath)); @@ -77,12 +77,13 @@ public class KernelUtils implements KernelConstants { if (osgiInstanceBaseUri != null) return safeUri(osgiInstanceBaseUri + (relativePath != null ? relativePath : "")); else - return Paths.get(System.getProperty("user.dir")).toUri(); + return Paths.get(System.getProperty("user.dir"), (relativePath != null ? relativePath : "")).toUri(); } static File getOsgiConfigurationFile(String relativePath) { try { - return new File(new URI(CmsActivator.getBundleContext().getProperty(OSGI_CONFIGURATION_AREA) + relativePath)) + return new File( + new URI(CmsActivator.getBundleContext().getProperty(OSGI_CONFIGURATION_AREA) + relativePath)) .getCanonicalFile(); } catch (Exception e) { throw new IllegalArgumentException("Cannot get configuration file for " + relativePath, e);