Improve nested OSGi runtimes
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / acr / CmsContentNamespace.java
index 02abd4cda2641d4ff2fcb2e3743f1061e787fd9b..62d57b6893526a7560d8f44cb8c67cfbe2d4291a 100644 (file)
@@ -1,9 +1,6 @@
 package org.argeo.cms.acr;
 
-import static java.lang.System.Logger.Level.ERROR;
-
 import java.net.MalformedURLException;
-import java.net.URI;
 import java.net.URL;
 import java.util.Objects;
 
@@ -55,17 +52,17 @@ public enum CmsContentNamespace implements ContentNamespace {
                Objects.requireNonNull(namespace);
                this.namespace = namespace;
                if (resourceFileName != null) {
-                       // resource = getClass().getResource(RESOURCE_BASE + resourceFileName);
-                       try {
-                               // FIXME workaround when in nested OSGi frameworks
-                               resource = URI.create("platform:/plugin/org.argeo.cms" + RESOURCE_BASE + resourceFileName).toURL();
-                       } catch (MalformedURLException e) {
-                               resource = null;
-                               System.getLogger(CmsContentNamespace.class.getName()).log(ERROR,
-                                               "Cannot load " + resourceFileName + ": " + e.getMessage());
-                               // throw new IllegalArgumentException("Cannot convert " + resourceFileName + "
-                               // to URL");
-                       }
+                       resource = getClass().getResource(RESOURCE_BASE + resourceFileName);
+//                     try {
+//                             // FIXME workaround when in nested OSGi frameworks
+//                             resource = URI.create("platform:/plugin/org.argeo.cms" + RESOURCE_BASE + resourceFileName).toURL();
+//                     } catch (MalformedURLException e) {
+//                             resource = null;
+//                             System.getLogger(CmsContentNamespace.class.getName()).log(ERROR,
+//                                             "Cannot load " + resourceFileName + ": " + e.getMessage());
+//                             // throw new IllegalArgumentException("Cannot convert " + resourceFileName + "
+//                             // to URL");
+//                     }
                        // Objects.requireNonNull(resource);
                }
                if (publicUrl != null)