Simplify CMS App deployment
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / osgi / BundleCmsTheme.java
index 6c195d45f48c742e377f92dcaf874073e843b368..3312d72f96eefff8ffa0552c0811e0870b87cdab 100644 (file)
@@ -327,10 +327,15 @@ public class BundleCmsTheme implements CmsTheme {
        @Override
        public InputStream loadPath(String path) throws IOException {
                URL url = themeBundle.getResource(path);
-               if (url == null)
-                       throw new IllegalArgumentException(
-                                       "Path " + path + " not found in bundle " + themeBundle.getSymbolicName());
-               return url.openStream();
+               if (url == null) {
+                       if (parentTheme != null)
+                               return parentTheme.loadPath(path);
+                       else
+                               throw new IllegalArgumentException(
+                                               "Path " + path + " not found in bundle " + themeBundle.getSymbolicName());
+               } else {
+                       return url.openStream();
+               }
        }
 
        private static Bundle findThemeBundle(BundleContext bundleContext, String themeId) {