One Hundred Hellos - Blog

Filesystem Walker - 07 November 2005

Traverse Directory tree advising IFileHandler
of each Directory and File that is reached:
org.galo.filesystem:

public interface IFileHandler {
public void handle(File f);
}
public class BaseWalker {
public BaseWalker(IFileHandler directoryHandler,
IFileHandler fileHandler) ;
}

There are static shortcuts:

int DirectoryWalker.count(File baseDir);
List DirectoryWalker.list(File baseDir);
int FileWalker.count(File baseDir);
List DirectoryWalker.list(File baseDir);