File dirlist = new File(suuid); String[] extensions = new String[] { "txt" }; List<File> files = (List<File>) FileUtils.listFiles(dirlist, extensions, true); for (File file : files) { // how can I do ? }
谢谢!
一个文件的 length()
length()
files.sort( Comparator.comparingLong(File::length) .thenComparing(f -> f.getName().substring(f.getName().lastIndexOf(".") + 1)));