title: print directory tree
body: <p>I have to print a directory tree (like tree command), example:</p>
  
  <pre><code> .
   +---A
   |   +---IMAGES
   |       +---BACKUP
   +---ADOKS
   |   +---ROZDZIAL_2
   |   +---ROZDZIAL_3
   |   +---ROZDZIAL_4
   +---AMSC2005
   |   +---AMSC2004
   +---FCCS2005
   |   +---source
   |   +---TMP
   +---LODZ2004
   +---ZAKOPANE2004
   +---DYDAKTYKA
   |   +---DYDAKTYKA_ISI
   |   |   +---COLLS
   |   |   |   +---Q1
   |   |   |   +---Q2
   |   |   |   +---RAZEM
   |   |   |       +---RYSUNKI_COLL1
   |   |   |       +---RYSUNKI_COLL2
   |   |   +---IMAGES
   |   |   +---src
   |   |   +---WYKLAD5
   |   +---DYDAKTYKA_PRG
   |       +---images
   |       +---POMOC
   +---DYDAKTYKA_KST
   |   +---images
   |   +---src
   +---DYDAKTYKA_WPR
       +---images
       +---src
  </code></pre>
  
  <p>I tried with the following Code:</p>
  
  <pre><code>private static void getInto(String p, int n) {
      File path = new File(p);
      File[] list = path.listFiles();
  
      for (int i = 0; i &lt; list.length; i++) {
          if (list[i].isDirectorhowny()) {
              for (int j = 0; j &lt; n; j++)
                  if (WHAT HERE?)
                      System.out.print("|  ");
                  else
                      System.out.print("   ");
  
              System.out.println("+--" + list[i].getName().toString());
  
              getInto(list[i].getPath(), n + 1);
          }
      }
  }
  </code></pre>
  
  <p>I tried few version, but it's still not work. How to do this? What condition should be put in If? I know is pretty simple, but I can't do  this.</p>