Skip to content

Conversation

@divanshu-techx
Copy link

@divanshu-techx divanshu-techx commented Jan 13, 2026

Summary

  • Add convenience method isRoot(String path) to check if a path represents the root path
  • Addresses the confusion mentioned in SLING-12824 about checking if getParent() returns null

Changes

  • Added isRoot() method in ResourceUtil.java
  • Added unit tests in ResourceUtilTest.java

Test Plan

  • Unit tests cover: root paths (/, ///, /a/..), non-root paths (/a, /a/b), and error cases

Add a convenience method to check if a path represents the root path.
This makes it more intuitive to determine if a path is root rather than
checking if getParent() returns null.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants