public static void main(String[] args) {
File dir = new File("f:\\day1");
List<File> list = new ArrayList<File>();
fileToList(dir, list);
File outfile = new File(dir, "Test.txt");
writeToOutfile(list, outfile);
File f2 = new File("f:\\filetest\\java.txt");
boolean b=outfile.renameTo(f2);
System.out.println(b);