title: How to list all files in a directory and its subdirectories in hadoop hdfs
body: <p>I have a folder in hdfs which has two subfolders each one has about 30 subfolders which,finally,each one contains xml files.
  I want to list all xml files giving only the main folder's path.
  Locally I can do this with <a href="http://commons.apache.org/io/" rel="noreferrer">apache commons-io's</a> FileUtils.listFiles().
  I have tried this</p>
  
  <pre><code>FileStatus[] status = fs.listStatus( new Path( args[ 0 ] ) );
  </code></pre>
  
  <p>but it only lists the two first subfolders and it doesn't go further.
  Is there any way to do this in hadoop?</p>