org.riotfamily.common.io
Class RecursiveFileIterator

java.lang.Object
  extended by org.riotfamily.common.io.RecursiveFileIterator
All Implemented Interfaces:
Iterator<File>

public class RecursiveFileIterator
extends Object
implements Iterator<File>

Iterator that iterates recursively over all files in a directory. Calling next() does not return nested directories, instead regular files contained in these directories are returned. Note that calling remove() will also delete all empty parent directories up to the base directory specified in the constructor.

Since:
8.0
Author:
Felix Gnass [fgnass at neteye dot de]

Constructor Summary
RecursiveFileIterator(File file)
           
 
Method Summary
 boolean hasNext()
           
 File next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecursiveFileIterator

public RecursiveFileIterator(File file)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<File>

next

public File next()
Specified by:
next in interface Iterator<File>

remove

public void remove()
Specified by:
remove in interface Iterator<File>