Is there any inbuilt method to check if dam: asset / any resource is Content fragment?
I am trying to put a condition in my code to check if given workitem ( in my custom workflow ) which is adapted in "resource" is whether content fragment or not.
I am not getting any specific method to do so.
For this I need to traverse to its jcr:cotnent and then check the property "content fragment" <boolean> is existed and if existed then whether value is true, which is making my code pretty big just to check if the resource is content fragment or not.
else if (workItemResource.adaptTo(ReplicationStatus.class).isDeactivated()
&& (workItemResource.adaptTo(Node.class).hasNode(JcrConstants.JCR_CONTENT)
&& workItemResource.adaptTo(Node.class).getNode(JcrConstants.JCR_CONTENT)
.hasProperty("contentFragment")
&& workItemResource.adaptTo(Node.class).getNode(JcrConstants.JCR_CONTENT)
.getProperty("contentFragment").equals(true)))
Please do let me know if any insights.