title: How to get url of all child,grand child pages using root path?
body: <p>I have a path of a root page and I want to retrieve all the child pages of root page and grandchild and grand grand child of root page. My structure is like this</p>
  
  <pre><code>rootPage
      |
      |
      |---------childPage
                      |
                      |
                      |---------grandChildPage
                                      |
                                      |
                                      |
                                      |----------------------grandGrandChildPages
  </code></pre>
  
  <p>So I want the path of all these pages. How can i get this?
  currently i'm using this</p>
  
  <pre><code>adminSession = repository.loginAdministrative( repository.getDefaultWorkspace());
                     ResourceResolver resourceResolver = request.getResourceResolver();
                     PageManager pageManager = resourceResolver.adaptTo(PageManager.class);
                     List&lt;String&gt;pageList = new ArrayList();
                      Page rootPage = pageManager.getPage("/content/abc/roi");
                      Iterator&lt;Page&gt; rootPageIterator = rootPage.listChildren();
                      while(rootPageIterator.hasNext())
                      {
                      Page childPage =    rootPageIterator.next();
                      String path = childPage.getPath();
                      pageList.add(path);     
                      }
  </code></pre>
  
  <p>But it provides me the only the child pages of root page and if i use rootPage.hasChild() then i have to pass the string which i can't because i don't now the name of pages. Is there any method which returns boolean value whether a page has child pages or not. I just want list of all pages inside root page which include grandChild as well as grandgrandCHild of root page.</p>
  
  <p>can anyone help ? </p>