Java - Read all .txt files in folder

后端 未结 7 1877
醉话见心
醉话见心 2020-12-08 15:49

Let\'s say, I have a folder called maps and inside maps I have map1.txt, map2.txt, and map3.txt. How can I u

7条回答
  •  星月不相逢
    2020-12-08 16:07

        final File folder = new File("C:/Dev Tools/apache-tomcat-6.0.37/webapps/ROOT/somefile");
        for (final File fileEntry : folder.listFiles()) {
               System.out.println("FileEntry Directory "+fileEntry);
    

提交回复
热议问题