[
https://issues.apache.org/jira/browse/OAK-9613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17702827#comment-17702827
]
Julian Reschke edited comment on OAK-9613 at 3/20/23 4:58 PM:
--------------------------------------------------------------
trunk: (1.44.0)
[c95ec1b2db|https://github.com/apache/jackrabbit-oak/commit/c95ec1b2db95b9e6a1fa6907cdc823e52b487481]
[ccf825dbab|https://github.com/apache/jackrabbit-oak/commit/ccf825dbabf8aebd308b683ce554b3ffd8bbbc9e]
1.22:
[85237a92cc|https://github.com/apache/jackrabbit-oak/commit/85237a92cc002e14c0c039bccd2805a4a28a9f42]
[9bd7b67066|https://github.com/apache/jackrabbit-oak/commit/9bd7b67066b7f1c438102bff4975a39449e41d70]
was (Author: reschke):
trunk: (1.44.0)
[c95ec1b2db|https://github.com/apache/jackrabbit-oak/commit/c95ec1b2db95b9e6a1fa6907cdc823e52b487481]
[ccf825dbab|https://github.com/apache/jackrabbit-oak/commit/ccf825dbabf8aebd308b683ce554b3ffd8bbbc9e]
> 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, 1.22.15
>
>
> 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.20.10#820010)