Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9613

Define API to retrieve parent or null for a given Item

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.42.0, 1.22.15
    • jackrabbit-api, jcr
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              angela Angela Schreiber
              angela Angela Schreiber
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: