刪除資料夾內的檔案

URL Link //n.sfs.tw/14706

2020-08-03 10:25:28 By igogo

 

lamdba 一行文

Arrays.stream(new File("/folder/path").listFiles()).forEach(File::delete);

 

https://stackoverflow.com/questions/13195797/delete-all-files-in-directory-but-not-directory-one-liner-solution