You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Angela Schreiber (Jira)" <ji...@apache.org> on 2021/11/05 12:14:00 UTC
[jira] [Resolved] (OAK-9613) Define API to retrieve parent or null
for a given Item
[ https://issues.apache.org/jira/browse/OAK-9613?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Angela Schreiber resolved OAK-9613.
-----------------------------------
Resolution: Fixed
> Define API to retrieve parent or null for a given Item
> ------------------------------------------------------
>
> Key: OAK-9613
> URL: https://issues.apache.org/jira/browse/OAK-9613
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: jackrabbit-api, jcr
> Reporter: Angela Schreiber
> Assignee: Angela Schreiber
> Priority: Major
> Fix For: 1.42.0
>
>
> as discussed in SLING-10011 it would be desirable to allow for retrieval of a Item's parent without having to deal with the exceptions that are thrown by {{Item.getParent()}} in case the parent does not exist or is not accessible.
> I would like to suggest to introduce {{JackrabbitSession.getParentOrNull(Item item)}}, which would return a {{Node}} or null. For backwards compatibility the new method should come with a default implementation that calls {{Item.getParent()}} and returns null in case of {{AccessDeniedException}} as it is thrown by _oak-jcr_ if there is no accessible parent or {{ItemNotFoundException}} in case of the root node.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)