@Test void testGetAbsoluteLevel_LegacyVersionHistory() { assertEquals(2, Path.getAbsoluteLevel("/content/versionhistory/user1/a/b", resolver)); assertEquals(1, Path.getAbsoluteLevel("/content/versionhistory/user1/a", resolver)); assertEquals(0, Path.getAbsoluteLevel("/content/versionhistory/user1", resolver)); }
public static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver) { if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) { return -1; } String originalPath = getOriginalPath(path, resourceResolver); return StringUtils.countMatches(originalPath, "/") - 1; }
Path { public static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver) { if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) { return -1; } String originalPath = getOriginalPath(path, resourceResolver); return StringUtils.countMatches(originalPath, "/") - 1; } }
Path { public static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver) { if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) { return -1; } String originalPath = getOriginalPath(path, resourceResolver); return StringUtils.countMatches(originalPath, "/") - 1; } private  Path(); }
Path { public static int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver) { if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) { return -1; } String originalPath = getOriginalPath(path, resourceResolver); return StringUtils.countMatches(originalPath, "/") - 1; } 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 int getAbsoluteLevel(@NotNull String path, @NotNull ResourceResolver resourceResolver) { if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) { return -1; } String originalPath = getOriginalPath(path, resourceResolver); return StringUtils.countMatches(originalPath, "/") - 1; } 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);  }