list fixed no of files from directory in java
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/354703/is-there-a-workaround-for-javas-poor-performance-on-walking-huge-directories">Is there a workaround for Java&#39;s poor performance on walking huge directories?</a>  </p>
</blockquote>



<p>I created a utility which lists all the files within some directory by using <strong>File.listFiles()</strong> function, but the problem occurred when i copied huge amount of files (around 100K) under that directory. </p>

<p>I was looking for some solution take actually takes some fixed no of files (say X) from that directory and processes and then deletes those files and takes next X number of files. 
Can any one please suggest me any solution. </p>

<p>Regards</p>
