ArrayList dirs = new ArrayList();
for (int i = 1; i < args.length; i++) {
if (args[i] == null) continue;
if (args[i].equals("-dir")) {
Path dir = new Path(args[++i]);
Path[] files = fs.listPaths(dir, new PathFilter() {
public boolean accept(Path pathname) {
try {
if (fs.isDirectory(pathname)) return true;
} catch (IOException e) {};
return false;