You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Konrad Windszus <kw...@apache.org> on 2021/10/26 08:21:07 UTC

ResourceResolver.create() for already existing resource

Hi,
From the javadoc of https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#create-org.apache.sling.api.resource.Resource-java.lang.String-java.util.Map- it is not clear to me what I should expect in case I try to create a resource which does already exist (with that name below that parent). What should happen in case the underlying resource provider does not support same name siblings?

Thanks,
Konrad


Re: ResourceResolver.create() for already existing resource

Posted by Konrad Windszus <ko...@gmx.de>.
Done in https://github.com/apache/sling-org-apache-sling-api/commit/7b299f865bb3ae6d2eedf0cd52cb5f937ed62d60.

> On 26. Oct 2021, at 11:50, Konrad Windszus <ko...@gmx.de> wrote:
> 
> Thanks for the confirmation. I will come up with a patch for an improved javadoc here.
> Konrad
> 
>> On 26. Oct 2021, at 11:17, Carsten Ziegeler <cz...@apache.org> wrote:
>> 
>> Hi,
>> 
>> agreed, that the javadoc could be more explicit. The idea is that a PersistenceException is thrown if the resource can't be created and that includes if a resource already exists at that path.
>> 
>> Regards
>> Carsten
>> 
>> Am 26.10.2021 um 10:21 schrieb Konrad Windszus:
>>> Hi,
>>> From the javadoc of https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#create-org.apache.sling.api.resource.Resource-java.lang.String-java.util.Map- it is not clear to me what I should expect in case I try to create a resource which does already exist (with that name below that parent). What should happen in case the underlying resource provider does not support same name siblings?
>>> Thanks,
>>> Konrad
>> 
>> -- 
>> Carsten Ziegeler
>> Adobe
>> cziegeler@apache.org
> 


Re: ResourceResolver.create() for already existing resource

Posted by Konrad Windszus <ko...@gmx.de>.
Thanks for the confirmation. I will come up with a patch for an improved javadoc here.
Konrad

> On 26. Oct 2021, at 11:17, Carsten Ziegeler <cz...@apache.org> wrote:
> 
> Hi,
> 
> agreed, that the javadoc could be more explicit. The idea is that a PersistenceException is thrown if the resource can't be created and that includes if a resource already exists at that path.
> 
> Regards
> Carsten
> 
> Am 26.10.2021 um 10:21 schrieb Konrad Windszus:
>> Hi,
>> From the javadoc of https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#create-org.apache.sling.api.resource.Resource-java.lang.String-java.util.Map- it is not clear to me what I should expect in case I try to create a resource which does already exist (with that name below that parent). What should happen in case the underlying resource provider does not support same name siblings?
>> Thanks,
>> Konrad
> 
> -- 
> Carsten Ziegeler
> Adobe
> cziegeler@apache.org


Re: ResourceResolver.create() for already existing resource

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

agreed, that the javadoc could be more explicit. The idea is that a 
PersistenceException is thrown if the resource can't be created and that 
includes if a resource already exists at that path.

Regards
Carsten

Am 26.10.2021 um 10:21 schrieb Konrad Windszus:
> Hi,
>  From the javadoc of https://sling.apache.org/apidocs/sling11/org/apache/sling/api/resource/ResourceResolver.html#create-org.apache.sling.api.resource.Resource-java.lang.String-java.util.Map- it is not clear to me what I should expect in case I try to create a resource which does already exist (with that name below that parent). What should happen in case the underlying resource provider does not support same name siblings?
> 
> Thanks,
> Konrad
> 

-- 
Carsten Ziegeler
Adobe
cziegeler@apache.org