]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/internal/runtime/KernelUtils.java
Refactor deploy properties and move legacy CMS exception.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / runtime / KernelUtils.java
index afcb9ff26a77d68502373e86a5eb2fd84280fa3d..2ada3c7269e2625e25bd78e6f28507c1889c11d5 100644 (file)
@@ -19,7 +19,7 @@ import org.argeo.api.cms.CmsLog;
 import org.argeo.cms.internal.osgi.CmsActivator;
 
 /** Package utilities */
-public class KernelUtils implements KernelConstants {
+class KernelUtils implements KernelConstants {
        final static String OSGI_INSTANCE_AREA = "osgi.instance.area";
        final static String OSGI_CONFIGURATION_AREA = "osgi.configuration.area";
 
@@ -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);
@@ -100,7 +101,7 @@ public class KernelUtils implements KernelConstants {
                return value;
        }
 
-       public static String getFrameworkProp(String key) {
+       static String getFrameworkProp(String key) {
                return getFrameworkProp(key, null);
        }