Class DirectoryIterator

  extended by com.google.common.collect.UnmodifiableIterator<T>
      extended by com.google.common.collect.AbstractIterator<java.io.File>
          extended by voldemort.utils.DirectoryIterator
All Implemented Interfaces:
java.util.Iterator<java.io.File>, ClosableIterator<java.io.File>

public class DirectoryIterator
extends com.google.common.collect.AbstractIterator<java.io.File>
implements ClosableIterator<java.io.File>

An iterator over all the files contained in a set of directories, including any subdirectories

Constructor Summary
DirectoryIterator(java.io.File... basis)
DirectoryIterator(java.lang.String... basis)
Method Summary
 void close()
          Close the iterator
protected  java.io.File computeNext()
static void main(java.lang.String[] args)
          Command line method to walk the directories provided on the command line and print out their contents
Methods inherited from class com.google.common.collect.AbstractIterator
endOfData, hasNext, next, peek
Methods inherited from class com.google.common.collect.UnmodifiableIterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
hasNext, next, remove

Constructor Detail


public DirectoryIterator(java.lang.String... basis)


public DirectoryIterator(java.io.File... basis)
Method Detail


protected java.io.File computeNext()
Specified by:
computeNext in class com.google.common.collect.AbstractIterator<java.io.File>


public void close()
Description copied from interface: ClosableIterator
Close the iterator

Specified by:
close in interface ClosableIterator<java.io.File>


public static void main(java.lang.String[] args)
Command line method to walk the directories provided on the command line and print out their contents

args - Directory names

Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu