@Test void testGetAbsoluteParent() { assertEquals("/content", Path.getAbsoluteParent("/content/a/b/c", 0, resolver)); assertEquals("/content/a", Path.getAbsoluteParent("/content/a/b/c", 1, resolver)); assertEquals("/content/a/b", Path.getAbsoluteParent("/content/a/b/c", 2, resolver)); assertEquals("/content/a/b/c", Path.getAbsoluteParent("/content/a/b/c", 3, resolver)); assertEquals("", Path.getAbsoluteParent("/content/a/b/c", 4, resolver)); assertEquals("", Path.getAbsoluteParent("/content/a/b/c", -1, resolver)); }
public static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver) { if (parentLevel < 0) { return ""; } int level = parentLevel + getAbsoluteLevelOffset(path, resourceResolver); return Text.getAbsoluteParent(path, level); }
Path { public static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver) { if (parentLevel < 0) { return ""; } int level = parentLevel + getAbsoluteLevelOffset(path, resourceResolver); return Text.getAbsoluteParent(path, level); } }
Path { public static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver) { if (parentLevel < 0) { return ""; } int level = parentLevel + getAbsoluteLevelOffset(path, resourceResolver); return Text.getAbsoluteParent(path, level); } private  Path(); }
Path { public static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver) { if (parentLevel < 0) { return ""; } int level = parentLevel + getAbsoluteLevelOffset(path, resourceResolver); return Text.getAbsoluteParent(path, level); } private  Path(); static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver); @SuppressWarnings("null") static Page getAbsoluteParent(@NotNull Page page, int parentLevel, @NotNull ResourceResolver resourceResolver); static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver); static String getOriginalPath(@NotNull String path, @NotNull ResourceResolver resourceResolver); static boolean isExperienceFragmentPath(@NotNull String path); static boolean isEditableTemplatePath(@NotNull String path); }
Path { public static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver) { if (parentLevel < 0) { return ""; } int level = parentLevel + getAbsoluteLevelOffset(path, resourceResolver); return Text.getAbsoluteParent(path, level); } private  Path(); static String getAbsoluteParent(@NotNull String path, int parentLevel, @NotNull ResourceResolver resourceResolver); @SuppressWarnings("null") static Page getAbsoluteParent(@NotNull Page page, int parentLevel, @NotNull ResourceResolver resourceResolver); static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver); static String getOriginalPath(@NotNull String path, @NotNull ResourceResolver resourceResolver); static boolean isExperienceFragmentPath(@NotNull String path); static boolean isEditableTemplatePath(@NotNull String path);  }