On Mon, May 6, 2013 at 3:47 PM, Alexander Klimetschek <aklim...@adobe.com> wrote: > ...This touches on the topic on how things like this on top of the resource > API should work in general. AFAIK, this is a first here... ... > The ResourceCollectionManager is really only needed to create a new > collection > (get and delete can be done via adaptTo and Resource directly)...
I agree that this doesn't sound consistent with the Sling's way of doing things - you have to get a special service or utility if the Resource that you want to create is of a specific type (collection). Without checking if that's doable, I'd be less surprised with properties.put("sling:resourceType", ResourceCollection.RESOURCE_TYPE); final Resource r = resourceResolver.create(parent, name, properties); final ResourceCollection c = r.adaptTo(ResourceCollection.class); Or even c = (ResourceCollection)resourceResolver.create(parent, name, properties) but that might fail. -Bertrand