title: Convert a list of URLs to a Tree
body: <p>Just to be sure I'm not reinventing the wheel, I want to see if there is some known algorithm, class, or something that can help me solve my problem. I have a huge list of URLs from an application. I'd like to feed those URLs into a tree to create a sitemap-like data structure. </p>
  
  <p>It seems that something like this may have done before. However, everything I see from my searches appears to do it from xml to tree. Ideally I'd like to have answer in Java, but I'm sure I could translate it to Java myself if necessary. If I need to do it myself, I'd probablty take each URL and break them into indexes.</p>
  
  <pre>
  [root]        [0]  [1]  [1] -file
  wwe.site.com/dir1/dir2/file.html
  [root]        [0]  [1]  [1]
  www.site.com/dirabc/dir2/file.html
  </pre>
  
  <p>So, I'd parse each url into offsets <code>[0], [1], [2], …</code> etc., and those be depth down in tree where to add them. That was at least my initial plan. I'm open to any and all suggestions!</p>