Improve ACR, introduce migration from JCR.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / acr / MountManager.java
index 6a6dcaacbe795ffa836f25f7738f62884f291310..8cb90893637b91ebd63dbb2b8db441c389384d46 100644 (file)
@@ -52,6 +52,13 @@ class MountManager {
                if (entry == null)
                        throw new IllegalArgumentException("No entry provider found for " + path);
                String mountPath = entry.getKey();
+               if (!path.startsWith(mountPath)) {
+                       // FIXME make it more robust and find when there is no content provider
+                       String[] parent = ContentUtils.getParentPath(path);
+                       return findContentProvider(parent[0]);
+                       // throw new IllegalArgumentException("Path " + path + " doesn't have a content
+                       // provider");
+               }
                ContentProvider contentProvider = entry.getValue();
                assert mountPath.equals(contentProvider.getMountPath());
                return contentProvider;