X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.cms%2Fsrc%2Forg%2Fargeo%2Fcms%2Facr%2Fdirectory%2FDirectoryContent.java;h=6e39280cee86a12bbb4d1dfa85f51ddedb8c392a;hb=55d88fba80cec198a0f11ba7545e19878c51fc5e;hp=50eea156d52442e6e406341d5aeaf105783c7d14;hpb=feddb4be70a8304dd4a533efee6e14c22691b500;p=lgpl%2Fargeo-commons.git
diff --git a/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java b/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java
index 50eea156d..6e39280ce 100644
--- a/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java
+++ b/org.argeo.cms/src/org/argeo/cms/acr/directory/DirectoryContent.java
@@ -45,4 +45,14 @@ class DirectoryContent extends AbstractDirectoryContent {
return provider.getRootContent(getSession());
}
+ @SuppressWarnings("unchecked")
+ @Override
+ public A adapt(Class clss) {
+ if (clss.equals(HierarchyUnit.class))
+ return (A) directory;
+ if (clss.equals(CmsDirectory.class))
+ return (A) directory;
+ return super.adapt(clss);
+ }
+
}