Retrieving a Future List of File
import org.pwss.io_file.FileTraverser;
import org.pwss.io_file.FileTraverserImpl;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
public class Main {
public static void main(String[] args) throws IOException,
ExecutionException,
InterruptedException {
FileTraverser fileTraverser = new FileTraverserImpl();
Future> future = fileTraverser
.traverse("C:\\Users\\PWSS\\" +
"Downloads\\ShredChat-master\\ShredChat-master");
while (!future.isDone()) {
}
List fileList = future.get();
fileList.forEach(f -> System.out.println(f.getAbsolutePath()));
fileTraverser.shutdownThreadPool();
}
}
org.pwss.io_file.FileTraverserImpl