public final class MultiDirFileIterator implements Iterator<File> {

	private final List<FileIterator> fileIterators = (List<FileIterator>) Collections
			.synchronizedList(new ArrayList<FileIterator>());
	private final AtomicInteger currentPos = new AtomicInteger(0);
	private final AtomicInteger fileIteratorsSize = new AtomicInteger(0);
	private final FileFilter filter;
	private final Lock iteratorLock = new ReentrantLock();
	private final FileReferenceHolder fileHolder = new FileReferenceHolder();

	public ConcurrentMultiDirFileIterator(FileFilter filterp) {
		this.filter = filterp;
	}

	public synchronized void addDirectory(File dir) {
		if (dir == null || !dir.isDirectory()) {
			throw new IllegalArgumentException("Only Directory allowed");
		}
		fileIterators.add(FileIterator.createFileIterator(dir, this.filter));
		fileIteratorsSize.incrementAndGet();
	}

	@Override
	public boolean hasNext() {
		fileHolder.setFile(getNext());
		return fileHolder.getFile() != null;
	}

	public void tryLock() {
		this.iteratorLock.lock();
	}

	protected File getNext() {
		File f = null;
		for (int i = 0; i < fileIteratorsSize.get(); i++) {
			FileIterator fiter = null;
			if (fileIteratorsSize.get() > 0) {
				currentPos.set(currentPos.get() % fileIteratorsSize.get());
			}
			if (currentPos.get() < fileIteratorsSize.get()) {
				fiter = fileIterators.get(currentPos.getAndIncrement());
			}
			if (fiter == null) {
				continue;
			}
			if (fiter.hasNext()) {
				f = fiter.next();
				break;
			} else {
				fiter = FileIterator.createFileIterator(fiter.getDir(),
						this.filter);
				fileIterators
						.set((currentPos.get() - 1) % fileIteratorsSize.get(),
								fiter);
			}
		}
		return f;
	}

	@Override
	public File next() {
		File f = fileHolder.getFile();
		return f;
	}

	public void unLock() {
		this.iteratorLock.unlock();
	}

	public void abort() {
		for (FileIterator fiter : this.fileIterators) {
			fiter.abort();
		}
		iteratorLock.unlock();
	}

	@Override
	public void remove() {
		throw new IllegalStateException(
				"Remove Operation is not allowed for FileIterator");
	}

}

@@ -1,12 +1,308 @@
+import java.io.File;%0Aimport java.io.FileFilter;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport java.util.concurrent.atomic.AtomicInteger;%0Aimport java.util.concurrent.locks.Lock;%0Aimport java.util.concurrent.locks.ReentrantLock;%0A%0A
 public final
@@ -1027,25 +1027,24 @@
 nly 
-Directory allowed
+aacept directory
 %22);%0A

Update MultiDirFileIterator.java