@Test void testGetAbsoluteParent_Page_Launches() { context.create().page("/content/launches/2018/01/01/launch1/content"); context.create().page("/content/launches/2018/01/01/launch1/content/a"); context.create().page("/content/launches/2018/01/01/launch1/content/a/b"); Page pageC = context.create().page("/content/launches/2018/01/01/launch1/content/a/b/c"); assertEquals("/content/launches/2018/01/01/launch1/content", Path.getAbsoluteParent(pageC, 0, resolver).getPath()); assertEquals("/content/launches/2018/01/01/launch1/content/a", Path.getAbsoluteParent(pageC, 1, resolver).getPath()); assertEquals("/content/launches/2018/01/01/launch1/content/a/b", Path.getAbsoluteParent(pageC, 2, resolver).getPath()); assertEquals("/content/launches/2018/01/01/launch1/content/a/b/c", Path.getAbsoluteParent(pageC, 3, resolver).getPath()); }
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);  }