import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Vector;
public class ListFile {
public static void recursion(String root, Vector<File> vecFile) {
File file = new File(root);
File[] subFile = file.listFiles();
for (int i = 0; i < subFile.length; i++) {
if (subFile[i].isDirectory()) {
recursion(subFile[i].getAbsolutePath(), vecFile);
} else {
vecFile.add(subFile[i]);
}
}
}
public static void main(String[] args) throws FileNotFoundException, IOException {
Vector<File> vecFile = new Vector<File>();
recursion("E:/TDDOWNLOAD", vecFile);
for (File file : vecFile) {
System.out.println(file.getName() + " " + new FileInputStream(file).available());
}
}
}