title: Traversing directories without using recursion?
body: <p><em><strong>The Problem</em></strong>
  I need to write a simple software that, giving certain constraints, appends to a list a series of files.
  The user could choose between two "types" of directory: one with a <em>*</em> wildcard meaning it should also explore subdirectories and the classic one without wildcards that just get files present in that directory.</p>
  
  <p><em><strong>What I'm doing</em></strong></p>
  
  <p>Right now I'm doing the stupidest thing:</p>
  
  <pre><code>import java.io.File;
  
  public class Eseguibile {
  
      private static void displayIt(File node){
  
          System.out.println(node.getAbsoluteFile());
  
          if(node.isDirectory()){
              String[] subNote = node.list();
              for(String filename : subNote){
                  displayIt(new File(node, filename));
              }
          }
      }
  
      public static void main(String[] args){
          System.out.println("ciao");
  
          displayIt( new File("/home/dierre/") );
  
      }
  
  }
  </code></pre>
  
  <p>I do not need to build a tree because I just need the files list so I was thinking maybe there's a more efficient way to do it.</p>
  
  <p>I was reading about the <a href="http://java.sun.com/products/jfc/tsc/articles/jtree/" rel="noreferrer">TreeModel</a> but, as I understand it, it's just an interface to implement a Jtree.</p>